Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can i use workspace.Gravity locally?

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

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.

2 comments

0

@ReallyUnikatni it's not really harder to exploit as exploiters create new local scripts.

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

Instead of using Gravity, have you tried using JumpPower?

1 comment

1

-1, you don't use the answer section to ask questions, this belongs as a comment

This discussion is preserved as it was. New answers, comments, and votes are closed.