`-- Print out a text
print("Text goes here")
-- Print out a text with value
local valuename = 10
print("Text goes here with value: " .. valuename)
-- Function
function FunctionName(...)
print(...)
end
FunctionName("Test", "threedotsahhthing")
function FunctionName2(text, bool)
print(text)
print(bool)
end
FunctionName2("Text 12535316+", false)
-- Tables
local Table = {
"One"; -- will be indexed as 1 ( Table[1] )
["PlayerName"] = "Developer" -- will be indexed as PlayerName
( Table[PlayerName] ), but the value will be "developer"
}
table.insert(Table, "Third") -- will insert a value into a table, and it will be
indexed with [3]
table.find(Table, "Third") -- Searches for a value in the table (in this case its
"Third")
if table.find(Table, "Third") then
print("Third found")
end
-- Services
local RunService = game:GetService("RunService") -- Service that runs every
tick(used for updating something with ur fps)
--//RunService usage
RunService.RenderStepped:Connect(function(dt)
print("Current DeltaTime is: "..math.ceil(dt))
end)
-- RunService.PreRender Does the same thing as RenderStepped
-- RunService:BindToRenderStep("BindName", 200) does the same thing as renderstepp
but instead of always being enabled, its being binded, and can be unbinded from the
client
-- RunService:UnbindFromRenderStep("BindName")
--//Debris
-- Debris service is used to destroy something, for ex:
local Debris = game.Debris
Debris:AddItem(workspace.SpawnLocation, 10) -- destroys spawnlocation part after 10
seconds
--//
--// bools
local bool = false
bool = true -- sets bool to true
if bool then
print("bool is true")
else
print("bool is false")
end
bool = not bool -- sets bool to the opposite
if bool then
print("bool is true")
else
print("bool is false")
end
bool = "Text"
print(bool)
--// If, else,ifelse, ==, <=, >=, =-, =+
-- If is used if you want to check for something
--// Ex:
if workspace:FindFirstChild("Baseplate") then
print("Baseplate Exists")
else
print("Baseplate doesnt Exists")
end
--// You can also use == to check instance bools
if workspace.Baseplate.Color == Color3.new(163, 162, 165) then
print("Baseplate color is 163, 162, 165")
else
print("Baseplate color is not 163, 162, 165")
end
local bool = 6
if bool <= 5 then
print("Bool is smaller or 5")
elseif bool <= 10 then
print("Bool is smaller than 10 or equals 10")
else
print("bool is greater than 10")
end
--// Instances
local instancenew = Instance.new("Part") -- Part for example
instancenew.Parent = game .Workspace -- sets parent for the part
instancenew. CFrame = CFrame.new(0,25,0) -- Set Parts location
instancenew.Anchored = true -- anchores part
local clone = instancenew:Clone()
clone. CFrame = CFrame.new(1,25,0) -- Set Parts location`