#I wanna know if this script works
1 messages · Page 1 of 1 (latest)
It won't
- Variables can't have spaces
Localmust be lowecase (local)Endmust be lowercase (end)
End .. Local .. local jump brick ... jump brick.Touched
So like
local jumpbrick = script.parent
jumpbrick.Touched:Connected(function(hit)
local character=hit.parent
local humanoid=character.FindFirstChild("Humanoid")
If humanoid then
Humanoid.JumpPower=150
End
End)
Just about
its .Parent instead of .parent
- waht ve said
Where
Humanoid.JumpPower=150
and character:FindFirstChild instead of character.FindFirstChild (. -> :)
Oh ye
u define character.FindFirstChild("Humanoid") as humanoid
Also forgot to replace the two uppercase ends with lowercase ones
A lot of mistakes
What
FindFirstChild is a method, you need to call it with the : character instead of the . character
Oh yea
I'll try to fix it
local jumpbrick = script.Parent
jumpbrick.Touched:Connected(function(hit)
local character=hit.Parent
local humanoid=character:FindFirstChild("Humanoid")
If humanoid then
humanoid.JumpPower=150
end
end)
** You are now Level 1! **
Is that ok?
Oh oh oh mb
local jumpbrick = script.Parent
jumpbrick.Touched:Connected(function(hit)
local character=hit.Parent
local humanoid=character:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpPower=150
end
end)
I think thats right, final thing would be some formatting to make the code easier to read and debug.
local jumpbrick = script.Parent
jumpbrick.Touched:Connected(function(hit)
local character = hit.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.JumpPower = 150
end
end)
- Spaces around equals
- Indent code thats inside a block