#Border activation script
143 messages · Page 1 of 1 (latest)
making it
only players touch
it could have touched other stuff such as the baseplate or any random part
@radiant nacelle
do you want the code
or
do i explain
it to u
sure then i would start with the explanation
am a beginner too but the tutorial channel i watch has things about touching
so lets start
now first
you have to check
if the thing that touched the ColPart is a Humanoid(Player)
so how you do that
function onTouched()
you can add a parameter called
"hit"
that "hit" parameter
is the thing that touched the ColPart
now when a player touches ColPart
it could be their head
or their torso
their left arm
so we cant know
so we do
hit.Parent
the parent of the player parts and humanoid
is the Player avatar in general
so after doing hit.Parent
your gonna have to find if the parent of hit has the child "Humanoid"
you can choose anything other than humanoid but i suggest using humanoid
because humanoid is used to change player speed and health and size etc
So how do you check if the Parent of hit has a child called humanoid
by simply typing
hit.Parent.FindFirstChild("Humanoid")
np its easy
be sure you include this in a variable
so you can use a if statement and know if humanoid is found or not
so do
Humanoid = hit.Parent.FindFirstChild("Humanoid")
then do
if Humanoid then
(your script)
end
thats all
i will give you the code and some examples you can do with humanoid and why i suggest choosing it
yeah
one sec
Beginner's Roblox Scripting Tutorial #10 - Events (Beginner to Pro 2019)
Hey guys, in today's video I am going to be teaching you about roblox events. or events in roblox. Basically, events are things that are fired whenever roblox sees them happen. So things like when a part is touched, or anything like that. These events are also called RBXSc...
this is the video
the channel name is devking
local door = game.Workspace.MapObjects
function onTouched(hit)
Humanoid = hit.Parent.FindFirstChild("Humanoid")
if Humanoid then
door.Border1.CanCollide = true
door.Border2.CanCollide = true
door.Border3.CanCollide = true
door.Border4.CanCollide = true
print ("ouchYOOOOOOOOOOOOOOOOO")
end
end
print ("part tdadse")
game.Workspace.ColPart.Touched:Connect(onTouched)
print ("part touched")
its really simple if you go through the video and my explanation
their very good
just try the code to check that there are no bugs because of spelling mistakes
oh
just make it
local Humanoid
and not Humanoid
its recommended to put local but it wont ruin the thing your doing

ik but
it helps
😭
he was the only guy that i could understand back when i was a beginner
pov: time for debugging
then something is wrong with what you did
show output
ye show the output
you had to put the humanoid thing but there is also a other bug
** You are now Level 5! **
so the variables and all names are correct
lemme try it
😭
oh
i mean abed
@radiant nacelle do you have folder for borders? (border1, border2, etc)
why it's called door 💀 ?
yo
caleb
are the borders
anchored
if not they fell out of the map
@radiant nacelle
Hello, Does anyone know how to fix it when i add pets to a egg it works but when i go to equip any pets it doesnt work when before it did dm me if you know how to fix please!
Hello, Does anyone know how to fix it when i add pets to a egg it works but when i go to equip any pets it doesnt work when before it did dm me if you know how to fix please!
...
bro sthu
SHUT UP
oh
lol
@radiant nacelle
Expected ':' not '.' calling member function FindFirstChild
sorry
fr
i typed something wrong
local door = workspace:WaitForChild("MapObjects")
local colpart = workspace:WaitForChild("ColPart")
function onTouched(hit)
if hit and hit.Parent then
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
door.Border1.CanCollide = true
door.Border2.CanCollide = true
door.Border3.CanCollide = true
door.Border4.CanCollide = true
end
end
end
colpart.Touched:Connect(onTouched)
that's why i said you're stupid
i sure am
now it should work
just swap the . with :
at findfirstchild
Caleb?? don't kill us
hmm
it must work
it worked with me
same variable names and folder
lemme post a vid
make sure
the borders a
are
anchored
are the borders anchored
can you show me screenshots
am back
so
can you make sure
you have any spelling mistakes
cause nothing is wrong in the code
is there errors
we checked the output
the only problem
was
we forgo to place a
: instead of .
in findfirstchild
so it worked for me
when i tested it
the only possible error is a spelling mistake or the borders getting deleted from the game by falling out of the map or something else
take this code
local door = game.Workspace.MapObjects
function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
door.Border1.CanCollide = true
door.Border2.CanCollide = true
door.Border3.CanCollide = true
door.Border4.CanCollide = true
print ("ouchYOOOOOOOOOOOOOOOOO")
end
end
print ("part tdadse")
game.Workspace.ColPart.Touched:Connect(onTouched)
print ("part touched")
ok nvm its the same exact code
maybe if you can ss gameplay
or ss the output
just make a video of the gameplay and output after touching ColPart
@waxen shale
Oh
