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:25
Roblox Studio Tutorials
3 years ago $0.03 earnedScripting 101: Rotating Coin
1272 -
LIVE
SternAmerican
23 hours agoFINAL ELECTION INTEGRITY CALL OF 2025 – WEDNESDAY, DECEMBER 17 | 1:00 PM EST
146 watching -
1:04:41
MYLUNCHBREAK CHANNEL PAGE
2 hours agoA.I. Destroys History
4.62K5 -
LIVE
The Mel K Show
2 hours agoMORNINGS WITH MEL K- Confronting Inverted Truth & Suicidal Empathy - 12-17-25
687 watching -
LIVE
The Shannon Joy Show
2 hours agoSJ LIVE Dec 17 - The Latest On #RealityDC: Queen Susie Takes Her Throne. Move Over Trump, There’s A New Sheriff In Town! With Special Guest - Independent Political Analyst Carey Wedler!
193 watching -
LIVE
Badlands Media
9 hours agoBreaking History Ep. 129
867 watching -
55:14
Grant Stinchfield
1 hour agoWhat Are They Hiding at Brown University, Campus Wokeness Blocks the Truth!
2.14K1 -
1:00:45
Trumpet Daily
1 hour agoTrumpet Daily LIVE | Dec. 17, 2025
1.46K -
25:37
Tudor Dixon
2 hours agoBondi Beach Attack, Radicalization, ISIS, and Rising Anti-Semitism | The Tudor Dixon Podcast
9112 -
1:02:04
VINCE
4 hours agoAre We Really Being Told The Full Story? | Episode 190 - 12/17/25 VINCE
180K105