Roblox How To Code - How To Script On Roblox - Episode 1
CTRL+I : Insert Opject
- Script.lua
```
game.Workspace.Hello.Transparency = 0.5
game.Workspace.Hello.Material = Enum.Material.Wood
game.Workspace.Hello.BrickColor = BrickColor.new("Really Red")
game.Workspace.Hello.Color = Color3.fromRGB(255,157, 37)
game.Workspace.Hello.Anchored = true
```
Beginner Roblox Scripting Tutorial 2 - Referencing & More Properties
https://youtu.be/_K7stCkqFBYdd
Beginner Roblox Scripting Tutorial 3 - Dice Game (Properties,Referencing Part 2]
```
-- tutorial 01
game.Workspace.Hello.Transparency = 0.5
game.Workspace.Hello.Material = Enum.Material.Wood
game.Workspace.Hello.BrickColor = BrickColor.new("Really Red")
game.Workspace.Hello.Color = Color3.fromRGB(255,157, 37)
game.Workspace.Hello.Anchored = true
-- tutorial 02
-- game.Workspace.My Brick.Transparency = 1 -- ERROR SPACE
--game.Workspace.56.Transparency = 1 -- ERROR Number
game.Workspace["My Brick"].Transparency = 1 -- OK
-- tutorial 03 - Dice Game
-- Workspace>gravity : 500
game.Workspace.MyDice1.Anchored = false -- roll first die
wait(0.5)
game.Workspace.MyDice2.Anchored = false -- role second die
```
Beginner Roblox Scripting Tutorial 4 - Variables
CTRL+G : Group
Double Group (Cascaded Group)
Instance.new() - Instancing tutorial - Roblox beginner scripting #5
Roblox Beginner Scripting - Functions (Ep 6)
Function Parameters / Arguments - Roblox Beginner Scripting #7
Returning - Beginner Roblox Scripting Tutorial #8
Built In Functions - Roblox Scripting for Beginners #9
```
-- tutorial 01
game.Workspace.Hello.Transparency = 0.5
game.Workspace.Hello.Material = Enum.Material.Wood
game.Workspace.Hello.BrickColor = BrickColor.new("Really Red")
game.Workspace.Hello.Color = Color3.fromRGB(255,157, 37)
game.Workspace.Hello.Anchored = true
-- tutorial 02
-- game.Workspace.My Brick.Transparency = 1 -- ERROR SPACE
--game.Workspace.56.Transparency = 1 -- ERROR Number
game.Workspace["My Brick"].Transparency = 1 -- OK
-- tutorial 03 - Dice Game
-- Workspace>gravity : 500
-- game.Workspace.MyDice1.Anchored = false -- roll first die
-- wait(0.5)
-- game.Workspace.MyDice2.Anchored = false -- role second die
-- tutorial 04 - Variables
wait(10)
game.Workspace.GameParts.MyDice.MyDice1.Anchored = false -- roll first die
wait(1)
game.Workspace.GameParts.MyDice.MyDice2.Anchored = false -- roll first die
game.Workspace.GameParts.MyDice.MyDice2.BrickColor = BrickColor.new("Really red")
-- 1
local MyDice = game.Workspace.GameParts.MyDice
MyDice.MyDice1.Anchored = false -- roll first die
wait(1)
MyDice.MyDice2.Anchored = false -- roll first die
MyDice.MyDice2.BrickColor = BrickColor.new("Really red")
-- 2
local MyDice1 = game.Workspace.GameParts.MyDice.MyDice1
local MyDice2 = game.Workspace.GameParts.MyDice.MyDice2
MyDice1.Anchored = false -- roll first die
wait(1)
MyDice2.Anchored = false -- roll first die
MyDice1.BrickColor = BrickColor.new("Really red")
MyDice2.BrickColor = BrickColor.new("Really red")
-- tutorial 05 - Instance.new()
local myPart = Instance.new("Part", game.Workspace)
myPart.Transparency = 0.5
myPart.Anchored = true
myPart.Position = Vector3.new(5,5,5)
myPart.Parent = game.Workspace
-- Scripting Tutorial #06
-- 1
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
-- 2 Functions
function generatePart1()
local part = Instance.new("Part")
part.Name = "MyAwesomePart"
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
end
generatePart1()
generatePart1()
generatePart1()
generatePart1()
generatePart1()
-- Scripting Tutorial #07 : Parameters / Arguments
function generatePart2(name)
local part = Instance.new("Part")
part.Name = name
part.BrickColor = BrickColor.new("really red")
part.Anchored = true
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = 0.6
part.CanCollide = false
part.Parent = workspace
end
generatePart2("PartNumberOne")
generatePart2("jjdjjd")
generatePart2("kjdakj")
generatePart2("jdjdj")
generatePart2("jjjjfj")
function generatePart3(name, isAnchored, reflectance)
local part = Instance.new("Part")
part.Name = name
part.BrickColor = BrickColor.new("really red")
part.Anchored = isAnchored
part.Position = Vector3.new(0,15,0)
part.Transparency = 0.5
part.Reflectance = reflectance
part.CanCollide = true
part.Parent = workspace
end
generatePart3("Hamburger", true, 1)
function printText(stringToPrint)
print(stringToPrint)
end
printText("Hell there!!")
wait(5)
printText("This is a message")
-- Scripting Tutorial #08 : Returning
function addNumbers(number1, number2)
local result = number1 + number2
return result
end
local calculationResult = addNumbers(3, 5) -- 8
print(calculationResult * 10)
function createPart(transparency, color, anchored)
local part = Instance.new("Part")
part.Transparency = transparency
part.Color = color
part.Anchored = anchored
part.Parent = workspace
return part
end
local myReturnedPart = createPart(0.5, Color3.fromRGB(255, 0, 0), true)
myReturnedPart.Color = Color3.fromRGB(0, 255, 0)
-- Scripting Tutorial #09 : Built In Functions
-- Destroy()
-- Clone()
-- ClearAllChildren()
-- wait()
-- print()
game.Workspace.Part:Destroy()
local myClone = game.Workspace.Part:Clone()
myClone.Parent = game.Workspace
wait(10)
game.Workspace.Part:ClearAllChildren()
print(5643)
```
'tech > game' 카테고리의 다른 글
21/07/21 AlvinBlox - 2020 Beginner Roblox Scripting Tutorials #2 (0) | 2021.07.21 |
---|---|
21/07/21 교실 수업에 Roblox 활용하기: 현직 교사들의 조언 (0) | 2021.07.21 |
21/07/19 Dust3D Tutorial (0) | 2021.07.19 |
21/07/19 How to Create a Low Poly Character in 23 Minutes using Dust3D (0) | 2021.07.19 |
21/07/19 EASILY MAKE 3D MODELS FROM SCRATCH! - WITH THIS FREE OPEN SOURCE TOOL (0) | 2021.07.19 |