Attempt to perform arithmetic (add) on number and Instance

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    Fix error

  2. What is the issue? Include screenshots / videos if possible!
    attempt to perform arithmetic (add) on number and Instance

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Devfourms

Local Script:

local amount = child.Num.Value
		
game.ReplicatedStorage.Remotes.ChangeFloorValue:FireServer(amount)

Script:

game.ReplicatedStorage.Remotes.ChangeFloorValue.OnServerEvent:Connect(function(amount)
	floors.Value = floors.Value + amount
end)
1 Like

The first argument of OnServerEvent is always (implicitly) the Player who invoked the event. You need to account for this:

game.ReplicatedStorage.Remotes.ChangeFloorValue.OnServerEvent:Connect(function(player, amount)
    print("Player invoked remote event", player.Name)
    floors.Value = floors.Value + amount
end)

Read more here.

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