Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How to correctly use parameters in FireServer:()? (SOLVED IT MYSELF)

CLOSED, I SOLVED IT MYSELF!

Hello, Devs!

So I was trying to make TextBox that if you will put any number in it, it will print the number on the server, not on client. I tried using RemoteEvents and parameters for FireServer:() and OnServerEvent, but it printed out only player username that put the number in output. Thanks in advice.

CODE:

LOCAL SCRIPT

local player = game.Players.LocalPlayer

script.Parent.FocusLost:Connect(function()
	game.ReplicatedStorage.RemoteEvent:FireServer(player, tonumber(script.Parent.Text))
end)

SCRIPT

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, text)
	print(player, text)
end)

OUTPUT:

No errors

ErktikyYT ErktikyYT Server

DETAILS:

Local script located in textbox, textbox located in ScreenGui script located in workspace remote event located in ReplicatedStorage

1 comment

0

You don't need to send the player yourself, Roblox does that for you. So just do: FireServer(Text);

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.