Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help Understanding RemoveEvent's?

Asked by 10 years ago

So I read the wiki article on RemoteEvent's, but it didn't really explain in the ways you can use it. So I wanted to do a few test with, I started off by creating a Cash Register. Then made the RemoteEvent in ReplicatedStorage, and then make a server script.

The way I was trying to use it was to send information to the server script so I could then use it in that script. The problem is when I fire it and try printing the information sent, it doesn't work. I never have used RemoteEvent's so I wanted to know if I'm doing this correctly?

Inside Register | Normal Script | Not all of the script

01local RegisterNum = 1
02local CurrentCustomer = nil
03local OrderRemote = game.ReplicatedStorage:FindFirstChild("CustomerServed")
04 
05function CheckCustomers(Place)
06    for _,v in pairs(Place:GetChildren()) do
07        local hum = v:FindFirstChild("Humanoid")
08        if hum then
09            local Selected = v:FindFirstChild("Selected")
10            if Selected then
11                if Selected.Value == "Location_"..RegisterNum then
12                    CurrentCustomer = v
13                    break
14                end
15            end
View all 25 lines...

Inside ServerScriptService | Normal Script | Not all of the script

1local OrderRemote = game.ReplicatedStorage:FindFirstChild("CustomerServed")
2 
3OrderRemote.OnServerEvent:connect(function(Register, Customer, Order)
4    print("Register #"..Register.." | Customer: "..Customer.." | Ordering: "..Order)
5end)

Error | ServerScript

1ServerScriptService.Script:4: attempt to concatenate local 'Register' (a userdata value)

Am I doing something wrong? If someone could help, it would mean a lot to me!

0
The error is on line 33 of the script, a line which we don't have. RaverKiller 668 — 10y
0
Yes you do, print("Register #"..Register.." | Customer: "..Customer.." | Ordering: "..Order) is the line. "Not all of the script" YasuYoshida 171 — 10y

Answer this question