So I've made a script that, when a button is pressed, it gathers information and sends it to my RemoteEvent, which is supposed to send it to trello.
****Original Script****
function onClicked() local suspect = game.Players:WaitForChild(script.Parent.Parent.reportplayer.Text) local caller = game.Players:WaitForChild(player.Name) local reason = script.Parent.Parent.reporttext.Text local sname = script.Parent.Parent.reportplayer.Text -- blah blah blah event:FireServer(suspect,caller,reason, sname) end
****Remote Event****
function sendCall(Suspect, Caller, Reason, SuspectName) --blah blah blah end local event = Instance.new('RemoteEvent', game:service'ReplicatedStorage') event.Name = 'Call' event.OnServerEvent:connect(sendCall)
Except it doesn't work...help?
The first variable for OnServerEvent
will always be the player who sent it. That might be where you're going wrong.
Server event listeners pass the client to the first argument of the given function, so just add an extra argument at the start of your function in the listener.
Line one of your second script should read:
function sendCall(n,Suspect, Caller, Reason, SuspectName)