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:39
Roblox Studio Tutorials
3 years agoScripting 101: Functions (Part 2) | Roblox Studio | 2022
59 -
33:02
DeVory Darkins
7 hours ago $34.24 earnedComey INDICTED by grand jury in shocking announcement by DOJ as Trump claims MAJOR VICTORY
38.4K93 -
2:06:23
Inverted World Live
8 hours agoEpstein Worked for CIA According to OMG Reporting | Ep. 114
133K41 -
3:14:39
TimcastIRL
8 hours agoTrump DOJ Indicts James Comey, The ARRESTS Have BEGUN | Timcast IRL
322K372 -
7:54:14
SpartakusLIVE
10 hours ago#1 Hulking MASS squashes NOOBS for viewers’ DELIGHT
72.6K2 -
1:32:21
The Charlie Kirk Show
8 hours agoTHOUGHTCRIME Ep. 98 — The Comey Indictment? Antifa Agenda? Charlie and the Cubs?
126K59 -
1:04:56
Sarah Westall
8 hours agoPolitical Assassinations, Targeted Hit Lists - Manufactured Chaos w/ Harley Schlanger
79.1K13 -
1:11:31
Flyover Conservatives
15 hours agoThe “J Walker” Secret: One Daily Habit That Shifts an Entire City - Tammy Hotsenpiller | FOC Show
68.8K4 -
2:12:02
Mally_Mouse
11 hours ago🎮Throwback Thursday! Let's Play: Wii Sports Resort!
56K2 -
5:43:34
Akademiks
8 hours agoATLANTA IS BACK. Young Thug and YFN best buddies now. ATL backs Thug officially!
72.5K2