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
-
8:39
Roblox Studio Tutorials
3 years agoScripting 101: Functions (Part 2) | Roblox Studio | 2022
62 -
19:13
Neil McCoy-Ward
3 hours agoJapan Just Lit The Fuse (Get Ready...)
3.5K3 -
1:03:37
Timcast
4 hours agoRepublicans Call For Mass EXPULSION Of Muslims, Travel BAN
171K122 -
1:14:15
Sean Unpaved
3 hours agoAaron Rodgers & Steelers BOUNCE BACK In WIN vs. Dolphins! | UNPAVED
19.3K4 -
DVR
Badlands Media
12 hours agoGeopolitics with Ghost Ep. 65 - December 16, 2025
22.5K1 -
1:49:22
Steven Crowder
6 hours agoCandace & Erika: What The Meeting Really Says About Conservative Media
464K384 -
16:28
Adam Does Movies
3 hours ago $0.47 earnedIT: Welcome To Derry Episode 8 Recap - What A Finale!
20.5K -
LIVE
LFA TV
18 hours agoLIVE & BREAKING NEWS! | TUESDAY 12/16/25
1,613 watching -
1:01:57
VINCE
7 hours agoThis Could Win Us The Midterms | Episode 189 - 12/16/25 VINCE
262K216 -
1:47:47
The Mel K Show
4 hours agoMORNINGS WITH MEL K- The End of Zero Sum Game Theory Thinking Has Arrived - 12-16-25
34.3K6