Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i use workspace.Gravity locally?

Asked by 4 years ago

i want to change the gravity but i want the gravity to be different for each player i try doing this and it doesnt work, it is in a local script:


game.Players.PlayerAdded:Connect(function(player) if player.Name == "Hish7x_io" then workspace.Gravity = 54 end end)

2 answers

Log in to vote
0
Answered by 4 years ago

The local script wont run you going into the server. Try this.

wait()
if game.Players.LocalPlayer.Name == "Hish7x_io" then
workspace.Gravity = 54
end

wait()
script:Destroy() --I'd just do this so it is a little harder to exploit.
0
@ReallyUnikatni it's not really harder to exploit as exploiters create new local scripts. BlackOrange3343 2676 — 4y
0
Apparently exploiters can access scripts even if destroyed, also please remove that wait() call at the first line - it's unnecessary and bad practice. Need to yield? Use :WaitForChild() or events. But you don't need any of that here, so just remove it programmerHere 371 — 4y
Ad
Log in to vote
-3
Answered by
pwx 1581 Moderation Voter
4 years ago

Instead of using Gravity, have you tried using JumpPower?

1
-1, you don't use the answer section to ask questions, this belongs as a comment programmerHere 371 — 4y

Answer this question