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
-
3:06:26
TruthStream with Joe and Scott
9 hours agoRoundtable with Patriot Underground and News Treason Live 4/26 5pm pacific 8pm Eastern
31.8K24 -
8:52
Tundra Tactical
7 hours ago $8.27 earnedSCOTUS Denies Appeal, Minnesota Courts Deal 2a Win!
38.3K8 -
LIVE
a12cat34dog
9 hours agoONE WITH THE DARK & SHADOWS :: The Elder Scrolls IV: Oblivion Remastered :: FIRST-TIME PLAYING {18+}
848 watching -
22:27
Exploring With Nug
16 hours ago $12.16 earnedSwamp Yields a Chilling Discovery in 40-Year Search for Missing Man!
52.3K17 -
1:23:26
RiftTV/Slightly Offensive
11 hours ago $10.96 earnedThe LUCRATIVE Side of Programming and the SECRETS of the "Tech Right" | Guest: Hunter Isaacson
61.9K16 -
27:57
MYLUNCHBREAK CHANNEL PAGE
1 day agoDams Destroyed India
69.1K24 -
LIVE
Phyxicx
11 hours agoLast minute practice before Sunday - 4/26/2025
169 watching -
LIVE
The Official Steve Harvey
10 days ago $4.99 earned24 HOURS OF MOTIVATION w/ STEVE HARVEY
71 watching -
4:36:25
MoFio23!
16 hours agoNintendo Switch It UP Saturdays with The Fellas: LIVE - Episode #16 [Clue]
25.8K3 -
7:02:48
StaleSavage
7 hours agoREPO GANGGANG
18.6K