game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() workspace.gravity "10" end) -- my script
so eh when i put it in it wont work how do i make it work
Alright, I got it working, basically you have to do script.Parent.Gravity
, instead of workspace.gravity
, also you missed some ends. Make sure this is a normal script inside of Workspace. You got it all right, except some minor errors, I tested this and it changes the gravity to 10 when you die.
Here is the code:
game:GetService('Players').PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) character:WaitForChild("Humanoid").Died:Connect(function() script.Parent.Gravity = 10 end) end) end)
Hopefully this worked/helped!
try this
game.Players.PlayerAdded:connect(function(player) local humanoid = player.character:WaitForChild("Humanoid") humanoid.died:connect(function() script.Parent.Gravity = 10 end) end)
put it in workspace. this is a awnser that may not be used much but is simple, short and eazily editable.