# Thread: Gravity to an objekt

1. ## Gravity to an objekt

Hi =)
Im making a 2d (wana b mmorpg) sci fi game, and i would like to have so that
the earth im making sould have gravity
Which meens the players gets draged to the earth instead of down
and when you walk around the earth your players cframe changes and the cameras cframe changes to so the guy always seems to stay straight up when he is at the bottom of the planet
Could someone make this script for me?
I know its kinda noobish asking for a whole script but iv only scripted in lua in roblox and this doesnt look like the roblox lua, Ty

Oh and if you play roblox im PlaceRebuilder =)

2. ## oh and

maybe the camera angole should look something like:

while true do
wait(1)
local a = script.Parent.CFrame
GetCamera.CFrame = a
end

?
and what should stand instead of script parent since i noticed it doesnt work in nova

3. ## Ok i got a starter, can i get help fixing it?

local massConstant = 1

local mass = 100000 * massConstant

local min = 0
local max = 550
while true do
wait(1)
local child = entyNumber:GetID()
local relPos = this:GetPos() - child:GetPos()
if relPos.magnitude * 240 * massConstant < mass then
local canContinue = true
if relPos.magnitude * 320 * massConstant < mass then
local length = mass / (320 * relPos.magnitude * massConstant)
if childSize[n].z * length > relPos.magnitude * 2 then
mass = mass + child:GetMass()
end
end
if canContinue then
local motivator = child:FindFirstChild("BlackHole Influence")
if motivator == nil then
motivator = Instance.new("BodyPosition")
motivator.Parent = child
motivator.Name = "BlackHole Influence"
end
motivator.position = this:GetPos()
motivator.maxForce = Vector2.new (1) * mass * child:GetMass() / (relPos.magnitude * massConstant)
end
else
local motivator = child:FindFirstChild("BlackHole Influence")
if motivator ~= nil then
motivator:Remove()
end
end
end

lolz i get stuck at wait since this lua doesnt have that command
Can someone help me fix this?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•