Help Understanding RemoveEvent's?
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
02 | local CurrentCustomer = nil |
03 | local OrderRemote = game.ReplicatedStorage:FindFirstChild( "CustomerServed" ) |
05 | function CheckCustomers(Place) |
06 | for _,v in pairs (Place:GetChildren()) do |
07 | local hum = v:FindFirstChild( "Humanoid" ) |
09 | local Selected = v:FindFirstChild( "Selected" ) |
11 | if Selected.Value = = "Location_" ..RegisterNum then |
20 | ClickDetector.MouseClick:connect( function () |
21 | CheckCustomers(game.Workspace) |
22 | if CurrentCustomer then |
23 | OrderRemote:FireServer(RegisterNum, CurrentCustomer, "Order" ) |
Inside ServerScriptService | Normal Script | Not all of the script
1 | local OrderRemote = game.ReplicatedStorage:FindFirstChild( "CustomerServed" ) |
3 | OrderRemote.OnServerEvent:connect( function (Register, Customer, Order) |
4 | print ( "Register #" ..Register.. " | Customer: " ..Customer.. " | Ordering: " ..Order) |
Error | ServerScript
1 | ServerScriptService.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!