Premium Only Content

Scripting 101: Functions (Part 3) Click Detector Event with Function
In this Roblox Studio tutorial connect a function to make a staircase to an in game click detector. Since this is a continuation of the last video, I provide the script below from "Functions (Part 2)". Copy it, create a "script" in your workspace, and you will have everything you need.
----- steps from part 2 --------
local yPos = 0
local zPos = 0
local stepHt = 2
local stepDist = 3
local function makeStep(y, z)
wait(.2)
local part = Instance.new("Part", workspace)
part.Position = Vector3.new(0, y, z)
part.Size = Vector3.new(10, .5, 3)
part.Anchored = true
part.TopSurface = Enum.SurfaceType.Smooth
part.BottomSurface = Enum.SurfaceType.Smooth
part.BrickColor = BrickColor.Random()
local colorName = part.BrickColor.Name
return part, colorName
end
wait(6)
for i=1, 10, 1 do
yPos = yPos + stepHt
zPos = zPos + stepDist
local p1, cName = makeStep(yPos, zPos)
p1.Material = Enum.Material.DiamondPlate
print("color name = ", cName, "i = ", i)
end
-
6:58
Roblox Studio Tutorials
3 years agoScripting 101: Touched Event | Roblox Studio | 2022
47 -
16:43
Mrgunsngear
9 hours ago $0.80 earnedKimber 2K11 Pro Review 🇺🇸
2.77K9 -
13:40
Michael Button
1 day ago $0.17 earnedThe Strangest Theory of Human Evolution
4484 -
10:19
Blackstone Griddles
1 day agoMahi-Mahi Fish Tacos on the Blackstone Griddle
8711 -
23:51
Jasmin Laine
1 day ago“Stop Wasting My Time!”—Trump's BRUTAL WARNING To Canada As Poilievre ROASTS CBC LIVE
1.74K15 -
9:54
Millionaire Mentor
1 day agoNBC Host EXPOSES JB Pritzker For Saying This About Trump
2173 -
1:35:39
SB Mowing
2 days agoIt took the WHOLE NEIGHBORHOOD to uncover this yards SHOCKING SECRET
73.3K60 -
12:52
ROSE UNPLUGGED
22 hours agoFrom Vision to Legacy: Charlie Kirk
45.8K19 -
1:14:22
Jeff Ahern
6 hours ago $10.58 earnedThe Sunday Show with Jeff Ahern
70.8K28 -
16:37
Professor Nez
7 hours ago🚨Internet MELTS DOWN over JD Vance & Trump BREAKING the Democrats!
64.8K181