Remote Event sending wrong data

I’m trying to make an admin panel in which the admins can adjust a users level

ConfirmButton.Activated:Connect(function()
	print(v.UserId)
	print(levelInput.Text)
	local level = tonumber(levelInput.Text)
	ChangeLevelEvent:FireServer(playerToEdit, level)
	levelUI.Visible = false
local function setDataStoreFired(playerToEdit, setLevel)
	print(playerToEdit)
	print(setLevel)
end

image

The prints coming from the local script is what it should be receiving and the green is what it is receiving

1 Like

You don’t need playerToEdit or v.UserId because the Player is included in Player-Server Remotes by default :grinning:

ConfirmButton.Activated:Connect(function()
	print(levelInput.Text)
--by the way check if Text can be converted to number at all
	ChangeLevelEvent:FireServer(tonumber(levelInput.Text))
	levelUI.Visible = false
local function setDataStoreFired(playerToEdit, setLevel)
	print(playerToEdit)
	print(setLevel)
end

And hey, check the docs :slight_smile:

2 Likes

The issue with this is, playerToEdit is the user I’m trying to edit (Which is not the command user) so by not sending this, the remoteEvent will only have the command user

(Update: I’ve found the issue) Thank you for the help!

1 Like