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
-
11:11
Morgonn
21 hours agoShould Biden DROP OUT of the presidential race??? We are being LIED to by the GOVERNMENT!!!!
9.94K14 -
22:09
ThinkStory
1 day agoHOUSE OF THE DRAGON Season 2 Episode 3 Breakdown & Ending Explained - Connection to Blood & Fire
4.66K2 -
40:00
Hack
1 day ago56 Brilliant Ways To Reuse Plastic Bottles.🔴 You Got To Try These Before You Trash One More
7.37K2 -
13:25
NC Dirt Hunter
1 day agoA Civil War battle in the swamp! Recovering historical relics Pt 1
10.9K1 -
1:02:33
ScammerRevolts
16 hours agoScammer Misses Out On $35,000 After I Troll Him For 3 DAYS!
6.17K4 -
22:35
Cody and Kellie
1 day agoOver 3,000 Mile Expedition to the Pacific Northwest in our Truck Camper
10.4K2 -
26:28
The Bitcoin Family
1 day agoBITCOIN CLOSED HIGHEST 6 MONTH CANDLE EVER, THIS IS NEXT!!
7.09K5 -
7:09
Chris Jericho
17 hours agoTalk Is Jericho Highlight: Anthony Michael’s Hall VACATION Story
9.32K1 -
40:37
Destene and Brandon
1 day agoWe saw our baby for the first time! | Destene and Brandon
9.04K4 -
1:05:56
Man in America
13 hours ago[LIVE] Something BIG is Happening...
33.9K126