–Variables–
local Brick = script.Parent
–End–
–Code–
local function PlayerTouched(Part)
local Parent = Part.Parent
if game.Players:GetPlayerFromCharacter(Parent) then
Parent.Humanoid.Health = 0
end
end
Brick.Touched:connect(PlayerTouched)
THAT IS SCRIPT
So what is the meaning of this : --Variables–
local Brick = script.Parent I’m vary new to this pls don’t call me stupid
That script sets a player’s health to zero when they touch a part.
1 Like
The script kills the player who touched the part.
What is local Brick = script.Parent mean
Those are variables. It’s basically setting a word, in that case “Brick” to a value, it can be a number, string (text), or even an object. In that case, it’s setting “Brick” to the parent of the script, so for the rest of that script if you say “Brick” like for example:
print(Brick.Name)
you’ll get the name of the scripts parent.
1 Like
Alright okay thank you @Pr0pelled.