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
1 year agoScripting 101: Functions (Part 2) | Roblox Studio | 2022
23 -
10:08
Roblox Studio Tutorials
1 year agoScripting 101: Functions (Part 1) | Roblox Studio | 2022
24 -
5:31
EasilyCoded
1 year agoUnravel the Mystery of JavaScript Functions! Arrow Function vs. Regular Function
7 -
5:44
Hogster Studio Design
1 year agoCreate Instance Function Script
3 -
5:36
sweshi2023
2 months agoCocos Creator 3D Game Tutorial 13 - Adding Click Events to a Button
23 -
6:22
ddand726
2 years agoVisual Basic Scripting Tutorial 7 functions
23 -
43:27
Hogster Studio Design
1 year agoCreate Effects Function Script
11 -
36:58
Hogster Studio Design
1 year agoLight Effect Function Script
3 -
9:56
LeeMorganIO
2 years agoJS Basics 011: Functions
12 -
21:42
1738 Creations Main
4 months agoDoom 2 (GZDoom) Modding - Actor Basics (Script and Decorate)
211