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
-
12:48
Roblox Studio Tutorials
2 years ago $0.02 earnedKnockback | Roblox Studio
2573 -
22:42
marcushouse
1 day ago $6.98 earnedMassive Surprises From Starship Flight 11 Revealed! 🤯
18.9K10 -
14:08
Forrest Galante
12 hours agoPrivate Tour Of the World's Most Expensive Pet Show
139K11 -
13:50
Nikko Ortiz
22 hours agoStop Hurting Yourself For Views.
25.3K12 -
2:07:06
Side Scrollers Podcast
1 day agoDiaper Furry Streamer Gets ONLY ONE DAY Suspension + Hasan PLAYS VICTIM + More | Side Scrollers
51.7K23 -
56:38
DeProgramShow
2 days agoDeprogram with Ted Rall and John Kiriakou: "Jake Tapper on the Global Hunt for an Al Qaeda Killer”
15.3K5 -
1:43:07
The Michelle Moore Show
2 days ago'The 12 Open Doors' Guest, Steve Jarvis: The Michelle Moore Show (Oct 17, 2025)
24.4K13 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
81 watching -
1:45:06
Badlands Media
1 day agoDevolution Power Hour Ep. 399: No Kings, Antifa’s Collapse & Trump’s Year of Peace
294K120 -
2:56:00
Laura Loomer
15 hours agoEP150: New Yorkers Brace For Islamic Takeover After Mayoral Election Debate
89.5K117