Value shows up as nil after being sent through a removeevent

After sending a value through a RemoveEvent, the value shows up as nil.

Client:

script.Parent.MouseButton1Click:Connect(function(player)
	Tile = script.Parent.Parent.TextBox.Text
	game:GetService("ReplicatedStorage").GameEvents.TileChosen:FireServer(player, Tile)
end)

Server:

game.ReplicatedStorage.GameEvents.TileChosen.OnServerEvent:Connect(function(player, Tile)
	print(Tile)
end)

In the output in says “nil” even though I entered a number into the TextBox. I also tried setting the number beforehand in the script so that it isn’t nil before you enter a number, but that changed nothing.

You do not need the player parameter in:

game:GetService("ReplicatedStorage").GameEvents.TileChosen:FireServer(player, Tile)

OnServerEvent automatically passes the player as the first parameter.

1 Like

Not sure why, but that fixed it. Roblox Studio is very weird sometimes.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.