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
2 years ago $0.02 earnedScripting 101: Rotating Coin
1222 -
2:35:33
Chrono
5 hours agoBirthday-eve Stream | Helldivers II
12.8K -
54:40
BonginoReport
1 day agoLABOR DAY SPECIAL! The Best of Nightly Scroll - Nightly Scroll w/ Hayley Caronia (Ep.124)
107K13 -
2:39:21
Joker Effect
3 hours agoReviewing the downfall of Kick Streaming. Kick streamers welcome to Rumble! Stake bombshell found!
20.2K1 -
1:06:10
Russell Brand
12 hours agoThe Greatest Lie Ever Told? - SF625
85.9K107 -
3:25:13
elwolfpr
4 hours agoBlack Ops 6: Rise of the Relentless
7.62K1 -
LIVE
Phyxicx
3 hours agoChillin - For The King - 9/1/2025
17 watching -
LIVE
Spartan
8 hours agoNew Game+ on E33, then back to Halo Grind
70 watching -
7:12:18
GrimmHollywood
9 hours ago🔴LIVE • GRIMM HOLLYWOOD • SKATE EARLY ACCESS • BRRRAP PACK • READY OR NOT •
18.9K4 -
3:08:11
SavageJayGatsby
7 hours agoLet's Play: Pacific Drive || $300 Weekly Goal - Spicy Bite Saturday || Teen Drinkin is Very Bad
15.7K