I am having trouble getting this local script to work. It is supposed to push you up whenever you touch any objects called "Wind", but it only works until you die at least once. After you respawn, nothing happens when touching wind. No error, nothing. I tried putting a few prints in, but none of those activated either. Also, the reason I am putting this into a local script instead of a server script every wind object is because I want no delay from the server.
p = game.Players.LocalPlayer
repeat wait() until p.Character
t = p.Character:WaitForChild'Torso'
t.Touched:connect(function(hit)
if hit and hit.Name == 'Wind' and not(t:FindFirstChild'BodyForce') then
local force = Instance.new('BodyForce', t)
force.Force = Vector3.new(0,7400,0)
end
end)
t.TouchEnded:connect(function(hit)
if hit and hit.Name == 'Wind' and t:FindFirstChild'BodyForce' then
t.BodyForce:Destroy()
end
end)

2 comments
Is the script in StarterPlayerScripts?
Yes, it is.