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
-
13:54
Roblox Studio Tutorials
2 years ago $0.06 earnedHow to Make a Gun | Roblox Studio
198 -
10:46
China Uncensored
19 hours agoHasan Piker Finds Out the Hard Way...
21.9K22 -
59:40
American Thought Leaders
16 hours agoHe Said No to Billions from China. Now They’re After Him | Declan Ganley
21.7K9 -
4:58
GreenMan Studio
15 hours agoTHE RUMBLE COLLAB SHOW EP.4 W/Greenman Reports
16.9K4 -
8:05
Freedom Frontline
18 hours agoAOC DISRESPECTS Byron Donalds And Gets DESTROYED Immediately
14.7K7 -
11:53
GBGunsRumble
16 hours agoGBGuns Range Report 15NOV25
10.9K1 -
21:37
Forrest Galante
11 hours ago6 Deadly Sea Monsters That Actually Exist
92K4 -
LIVE
Lofi Girl
3 years agolofi hip hop radio 📚 - beats to relax/study to
363 watching -
43:24
ThisIsDeLaCruz
1 day ago $9.39 earnedWhat Fans Never Knew About Falling In Reverse’s Guitarist
29K -
14:57
The Pascal Show
1 day ago $5.76 earnedTHIS IS INSANE! Megyn Kelly SLAMMED For Questioning Whether Epstein Was a P*dophile?!
17.9K18