#I did something wrong :C

128 messages · Page 1 of 1 (latest)

torpid surge
#

idk what i did wrong
code:
local textButton = script.Parent

local function onActivated()
counter = counter +1
end

if counter = 1 then game:GetService('TeleportService'):Teleport(16043365517, subt0silver)
end)

green widget
torpid surge
#

enlgish pls

brazen wadi
#

ok so do u know variables?

torpid surge
#

not really

brazen wadi
#

ok so variables have two parts

#

the name of the variable

#

and what is actually contained in the variable

#

so the value of the variable

#

to make a variable u do:

local x = 21

#

this is a variable called x with the value 21

torpid surge
#

oh

#

so math variabes

brazen wadi
#

now whenever u wanna use 21 in ur code, u dont have to explicitly write 21, u can just use x

torpid surge
#

oh ok

#

so can i do x = counter?

#

then x = 1

brazen wadi
#

let's say u wanna print out x + y

#

we know x is 21

#

but wth is y

torpid surge
#

then u do algebra

inland cypressBOT
#

studio** You are now Level 2! **studio

brazen wadi
#

u cant do x+y if you havent defined what y is

torpid surge
#

x+y = 21

brazen wadi
#

so that would be

#

local y = x

torpid surge
#

21-x=y

brazen wadi
#

so x and y hold the same value

#

and then u can do x+y

#

without it showing an error

torpid surge
#

ok

#

wait wha

brazen wadi
#

basically all im saying is

#

for example

#

u wrote subt0silver

#

and it's giving a red underline

#

cuz it doesnt know what subt0silver is

torpid surge
#

:/

brazen wadi
#

because u didnt tell it what subt0silver is

torpid surge
#

im subt0silver

#

subt0silver = player

brazen wadi
#

ok but u didnt write that

torpid surge
#

does that work

#

how do i write that

brazen wadi
#

u cant just do subt0silver = player

#

because it doesnt know what player is

#

player isnt a keyword or anything

torpid surge
#

how do i explain player

brazen wadi
#

however

#

u can do subt0silver = game.Players.LocalPlayer

torpid surge
#

wow

brazen wadi
#

local subt0silver = game.Players.LocalPlayer

#

u can keep the name of the variable as subt0silver for now

torpid surge
#

yey :D

brazen wadi
#

but u should learn later how localplayer and local scripts work

torpid surge
#

ok

brazen wadi
#

actually i can explain now

#

basically

torpid surge
#

another thing to miserably fail at :D

brazen wadi
#

when u play a game on roblox

green widget
brazen wadi
#

the server is the computer that's running the game at roblox HQ (for example)

green widget
#

Is this an ai script?

brazen wadi
#

the clients are the devices/computers that connected to the game, aka the players

#

(normal) scripts run on the server

#

and local scripts appear on the client devices

#

and run there

torpid surge
#

brb

brazen wadi
#

when u do localplayer, it refers to oneself

green widget
#

right but variables exist in every single programming language

brazen wadi
#

so basically 3 players join the game, each of them will have the same local scripts and those local scripts will run for them on their own computer

green widget
#

and they're the first thing anybody learns when they learn how to code

brazen wadi
#

if u do something like print(game.Players.LocalPlayer) in a local script, on each of those 3 players' computer it will print their player name

#

cuz each player is a different player

green widget
#

alright please just watch some videos about the basics of lua(variables, functions, types, etc.)

torpid surge
#

@brazen wadi ty

brazen wadi
#

np

torpid surge
#

ima test and report back if somethings till wrong

#

ok

#

is counter a keyword?

brazen wadi
#

no

torpid surge
#

oh

#

thats what it is

#

counter = counter +1

brazen wadi
#

u can do that

#

but first u have to define what counter is

torpid surge
#

yep

brazen wadi
#

ur saying that "counter is itself plus 1" (increasing it by 1)

#

but what even is counter

torpid surge
#

every time u click button

#

it add 1

brazen wadi
#

u have to do:
local counter = 0

#

to start it off

torpid surge
#

oh

#

makes sense

brazen wadi
#

also in the if statement when u do equality check, u have to use ==

torpid surge
#

0 + 1 = 1

brazen wadi
#

cuz just 1 = is for assignment while 2 = means equality check

torpid surge
#

now ima test

inland cypressBOT
#

studio** You are now Level 3! **studio

torpid surge
#

no red tho

#

which seems good

#

nope

brazen wadi
#

any errors in the output?

green widget
torpid surge
#

idk

brazen wadi
#

also u cant teleport in studio

#

u have to play the game on roblox

#

and u also need to enable that one game setting

torpid surge
#

OH

brazen wadi
#

to allow teleporting

torpid surge
#

oop

#

i do have setting

#

tho

#

i did that

#

third party teleports

green widget
torpid surge
#

now ima test on rblx

brazen wadi
#

then u gotta publish ur game and try on roblox

torpid surge
#

the text broke :C

#

gotta fix that

#

i cant publish it bc wifi is bad rn

#

ill publish it in a bit

#

welp

#

somethings still wrong

#

:C