So I'm trying to bring a value using a RemoteEvent with FE on So I was thinking "()" might be the value carry but it won't work as it prints "iRexBot"
Here is the script:
Localscript:
local Players = game:GetService('Players') local Player = Players.LocalPlayer local Storage=game:GetService('ReplicatedStorage') local Event=Storage:WaitForChild('ParticalEvent') function onClick() local num = 1 Event:FireServer(num) end script.Parent.MouseButton1Click:Connect(onClick)
Script:
local Storage = game:GetService('ReplicatedStorage') local Event = Storage:WaitForChild('ParticalEvent') --Core function onFired(num) print(num) end Event.OnServerEvent:Connect(onFired)
OnServerEvent implicitly passes the player that fired it in the first place as the first argument (which is why it printed your name, iRexBot
).
You can fix it by adding an extra parameter to your onFired function.
function onFired(player, num) print(num) end