Hello there, I have recently been trying to create my roblox game and I have run into a slight roadblock. It seems when I fire a remote event the variables are getting mixed up and it is not working as intended. The first script is a local script inside of a button which sends the player and amount of stuff they get through a remote event, the second script has the remote event as the child and prints what each value is. If anyone could help me I would appreciate it
script.Parent.MouseButton1Click:Connect(function()
local personSad = game.Players.LocalPlayer
local RebirthM = 0
local PetM = 0
local WorldM = 1
local Amt = RebirthM+PetM+WorldM
workspace.Main.RemoteEvent:FireServer(personSad, Amt)
end)
You don’t need to send "personSad" to the server inside the :FireServer(). It is already there for you by default when using any remote so you can actually just do :FireServer(Amt).
An argument is what you pass to a function/method’s specific parameter. A parameter is what the function is expecting to receive and handle inside the function itself if it has been specified by the programmer function Name(param1, param2)