You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localc="" -- the name can be anything (e.g local egg = "bla bla bla")locald=canbeagameidtooorsumthings! -- if you try to run this it will give you an error so add numbers in there or sum thingslocalfunctionc() -- you can make functions too!print("b")
end)
printing/using variables
locald="c"localf=2localc=3localfunctionc() -- you can make functions too!(you can change the c to what you want)print("b")
end)
print(d) -- prints whats in the string in the variable in dprint(f+c) -- does math for you lol (2 + 3)c() -- runs the c function(if you set it to anything other you need to change it then!)
tables
localtable= {
"table_1",
"table_2"
}
print(table[1]) -- prints table_1 and if you do print(table[2]), it will print table_2--------------------------------------------------------------------------------------------mytable= {}
mytable[1]="Lua" -- sets the first string of the table to Lua
if statements
localb=false; -- says if its true or falseifb==falsethen-- if it b is false then it will print Hello Worldprint("Hello World")
endlocalname=game.Players.LocalPlayer.Name-- the name of the localplayer (only for roblox games!)ifname=="idk" then-- if the name from the roblox player is idk it will print whitelisted or sum thing, you can use this as an beginner whitelist!print("whitelisted or sum things")
end
loops with while
whiletruedoprint("idk make a loop or sum") -- loops print: idk make a loop or sumwait() -- do not remove this or else your game will crashend
getgenv and _G. (only used for exploits)
-- this for roblox games (not main lua)getgenv().c=true;
whilegetgenv().c=truedo-- you can use this to loop an function (you can stop it by changing getgenv().c to false!print("true")
wait()
endifgetgenv().c==falsethen-- if getgenv().c = false it will print falseprint("false")
end---------------------------------------------------------------------------------------------using _G._G.c=true;
while_G.c=truedo-- you can use this to loop an function (you can stop it by changing _G.c to false!print("true")
wait()
endif_G.c==falsethen-- if _G.c = false it will print falseprint("false")
end
part touched founction
-- this for roblox games (not main lua)localpart=script.Parent.Parent.partnamehere-- this is if you script is in workspacelocalpart_other=game.Workspace.partnamehere-- if you use a script that is outside of Workspacepart.Touched:Connect(function() -- connects a function when the part is touched!wait(1) -- only added the wait so it won't spamm Hello World but you can remove it!print("Hello World!") end)
scripts for ui buttons
-- this for roblox games (not main lua)localbutton=script.Parent.Parent.buttonnamehere-- buttonlocalbutton_2=script.Parent.Parent.framenamehere.buttonamehere-- if this button does not show up use this!button.MouseButton1Down:Connect(function() -- connects a function when the button is clickedprint("ok") -- if the button is clicked it will print okend)
--------------------------------------------------------------------------------------------------------------------------- using TweenService with buttons or uis (for roblox games only i think and its used for animations!)localframe=script.Parent.Parent.framenameherebutton.MouseButton1Down:Connect(function() frame:TweenPosition(UDim2()) -- this will change the Frame Position with an animation, here is how a Position should look like: {0.301, 0},{0.207, 0} you can keep the {} if you want but you don' have to-- how to get the Position:--[[ StarterGui<URScreenUi<UrFrame<properties<Position--]]end)
-- how do I get the frame size?:--[[ StarterGui<URScreenUi<UrFrame<properties<Size--]]button.MouseButton1Down:Connect(function()
frame:TweenSize(UDim2()) -- this will change the Size Frame with an animation, here is how a size should look like: {0, 506},{0, 234} you can keep the {} if you want but you don't have toend)
-- you can use TweenSizeAndPosition to change both at the same time! (first the size then the position,should look like this: {0, 506},{0, 234},{0.301, 0},{0.207, 0})---------------------------------------------------------------------------------------------------------------------------------------- just animating the frame without any buttonframe:TweenPosition(UDim2()) /frame:TweenSize(UDim2())
using textboxes
-- this for roblox games (not main lua)localbox=script.Parent.Parent.textboxnameherelocalbutton=script.Parent.Parent.buttonnamehere-------------------------------------------------button.MouseButton1Down:Connect(function() -- uses an button (dont add this script to your textbox)print(box.Text) -- prints the text that has been inputted in the TextBox end)
-----------------------------------------------------------box.Focused:Connect(function() -- if the textbox is clickedprint("Hi")
end)
box.FocusLost:Connect(function() -- if you click anywhere outside the textboxprint('bye')
end)