#Explanation
46 messages · Page 1 of 1 (latest)
ok
btw i mean just this
line 1 - detect the part
so, when i create a variable with "script.parent" value, the variable represents the part?
yea the script is in the part
so u can use script.parent
no, but i can get it rn if u want
ok
so what happen if i get 2 variables with script.parent?
u cant its only one variable
local part = script.parent
part.touched:Connect(function(hit)
local h = hit.parent:FindFirstChildren("Humanoid")
if h then
h.WalkSpeed = 500
end
end)
so the variable "h" represents the humanoid (player) and "part" its the game part?
this code do the same
yes
Walk speed in Humanoid
jump hight and health in humanoid too
what "hit.parent:FindFirstChildren" do?
hit is the function name
parent is the char or player who toched the part
FindFirstChild to find Humanoid in player char
wait so why need type function name in start
** You are now Level 2! **
part.touched:Connect(function(hit) touched is event thatuse with parts
function any thing btween this () its the name of that function
bcs player will touch the part so player will be the parent of this part and frome here we can get Humaoid
** You are now Level 5! **
ohh
alr
ty for explaning
this will help me
alr
i will try without checking my last scripts
and if anything u struggle with just send me
ok
good
u did the script ?
yep