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

I have a problem with my remote event with adding?

The problem is that created a mouse click script that add clicks to the player clicks and then i created a remote event wrote the script (not local script) and then when i tried adding the intvalue value to the player clicks intvalue but in the output it says: ServerScriptService.Script:3: attempt to perform arithmetic (add) on number and Instance Heres the mouse script (the parent of script is starter pack service) :

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()

Sent = Player.Tier.Value
Player.Tier.Changed:connect(function()
Sent = Player.Tier.Value
end)

Mouse.Button1Down:connect(function()
	game.ReplicatedStorage.NewPointsToServer:FireServer(Player,Player.Tier.Value)
	print(Sent)
end)

and heres the remote event on server event (its a serverscriptservice script)script:

game.ReplicatedStorage.NewPointsToServer.OnServerEvent:Connect(function(Player,Clicks)
	local TruePlayer = game.Players:WaitForChild(Player.Name)
	TruePlayer.leaderstats.Clicks.Value = TruePlayer.leaderstats.Clicks.Value +Clicks
end)

Pls help me????????????????????????????????????????????????????????

1 answer

✓ Accepted answer

When firing the server, the server gets the player automatically. Just replace line 10 in the mouse script with game.ReplicatedStorage.NewPointsToServer:FireServer(Player.Tier.Value).

1 comment

0

THX BROOOOOOOOOO

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