#How should I be learning scripting?

1 messages · Page 1 of 1 (latest)

rose galleon
#

Someone told me that not watching tutorials was wrong and I’m just copying not learning if I’m asking for help from other people what do I do?

rose galleon
#

if thats what ur saying

#

i want to make something cool like this

#

when i ask for help just because i forget that i made a small little error like

#

')'

#

they say im copying

rose galleon
#

@buoyant tendon pyro

#

i want to better understand modules

#

can i use remotevents along with modules?

broken arrow
broken arrow
rose galleon
broken arrow
#

a

broken arrow
rose galleon
#

for mouse button down

#

i think

rose galleon
broken arrow
#

Like Input.UserInputService == Enum.UserInputService.Mousetype

#

Like mousebutton1

rose galleon
#

what are remote events for

broken arrow
#

a

#

@rose galleon

broken arrow
# rose galleon what are remote events for

lets say, you have a client script, and the client is called "Sylis", and you want to tell the server that the client got a coin or something, you would do it like this,

-- Client Script

local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent:FireServer("Got a Coin") -- This tells the server, what player fired this remote event, and the args, in this case: "Got a Coin"
-- Server Script

local RemoteEvent = game.ReplicatedStorage.RemoteEvent
RemoteEvent.OnServerEvent:Connect(function(Player, Args)
  print(Player, Args)  -- Prints "Sylis Got a Coin"
end)
#

you can use this to relay any information you want.

#

also a thing you can do with functions,

local function ShowCase(Something, Something2, ...)
  print(Something,Something2, ...)
end

ShowCase("A", "b", "C", "D4") -- will print A b {"C", "D4"}

local function ShowCaseTwo(Something, Something2, ...)
  local Something3, Something4 = table.unpack(...)
  print(Something1, Something2, Something3, Something4)
end

ShowCaseTwo("A" "b" "CDDD" "Y") -- will print A b CDDD Y

-- "..." is basically a list that stores everything else.
broken arrow
#

OR

#

it tells the server

rose galleon
#

should i restrat this dialogue system

#

restart

broken arrow
#

if you do Event:FireServer(args) it gives the server the player and the args

#

lemme check

rose galleon
#

when i press the button to end the dialogue system

#

someone said to use modules as it's cleaner

broken arrow
#

so

#

lets say you have a list which you know will have 3 values, and you want to unpack those values into variables, you would do it like this

local Var1, Var2, Var3 = table.unpack({"A","B","C"})
print(Var1, Var2, Var3) -- A B C

you can also add as many variables, even if the table doesnt have that much, BUT you do need to check if the variable == nil because it can mess up things

local Var1, Var2, Var3, Var4, Var5 = table.unpack({"A", "B"})
print(Var1, Var2, Var3, Var4, Var5) -- A B nil nil nil

broken arrow
rose galleon
broken arrow
#

store the text and the num value in them, and then write the text from them, so you can easily edit the text

rose galleon
#

i want them to have mouse button down