Hi, The code you are seeing below is the working piece of code the line which was not working before was the hit = game.Workspace line this code only started to work when I added in the .Player1 before I was just trying game.Workspace:FindFirstChild("Humanoid") which didn't work the error I received was the following -
Workspace.Part.Script:3: attempt to index local 'hit' (a nil value)
I tried making hit local but still no luck. I need to know why it wasn't working as I am experimenting to help me learn Lua better. Thanks in Advance!
function asfasga(hit)
hit = game.Workspace.Player1:FindFirstChild("Humanoid")
hit.JumpPower = 100
hit.WalkSpeed = 60
end
script.Parent.Touched:connect(asfasga)

1 comment
Hi, soved I tried anchoring the part but still no luck and the code you have put in your answer is a bit complicated can you please simplify it?