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

turn down gravity on death?

Asked by 5 years ago
Edited by theking48989987 5 years ago
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

0
First of all, doing this from the server is basically useless... Second... Do it from client duh.. third.. workspace.gravity is meant to be workspace.Gravity.... fourth, you are missing ends, fifth, you gotta elaborate on your question... greatneil80 2647 — 5y
0
like dur you you should duh elaborate on yer dur list of uhh answers duh ForeverBrown 356 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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!

Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

Answer this question