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
-
36:10
Roblox Studio Tutorials
2 years agoDeadly Farts on Rolox!
3047 -
LIVE
SpartakusLIVE
3 hours agoHUGE NEW UPDATE - Aim Assist NERF, New META, New MOVEMENT || #1 King of Content
220 watching -
LIVE
XDDX_HiTower
2 hours agobattlefield 6 with the crew! [RGMT CONTENT Mgr. | RGMT GL | GZW CL]
100 watching -
2:28:57
Nikko Ortiz
3 hours agoVirtual Reality Milsim... | Rumble LIVE
20.5K4 -
LIVE
StevieTLIVE
2 hours agoNEW UPDATE Warzone WINS w/ The Fellas
58 watching -
9:00:32
Dr Disrespect
11 hours ago🔴LIVE - DR DISRESPECT - WARZONE x BLACK OPS 7 - SEASON 1 INTEGRATION
137K7 -
1:25:00
Sam Tripoli
3 hours ago $1.87 earnedPunch Drunk Sports LIVE!
10.4K2 -
55:45
MattMorseTV
3 hours ago $8.94 earned🔴Trump scores 3 VICTORIES in ONE DAY.🔴
14.8K31 -
LIVE
Badlands Media
8 hours agoSITREP Ep. 137
2,081 watching -
1:53:04
Barry Cunningham
6 hours agoLIVE BREAKING NEWS: President Trump And Melania Trump Host The National Christmas Tree Lighting
72.3K12