FireServer not working as intended

Why is “Val” sending to the server as the Player value??

client:

local Cooldown = false

local Player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function()
	if Cooldown == false then
	Cooldown = true
	local NumberCheck = tonumber(Player:WaitForChild("PlayerGui").Menus.Vault.Main.Holder.Amount.TextBox.Text)
		if NumberCheck ~= nil and NumberCheck >= 1 and Cooldown == true then
			local Val = math.round(NumberCheck)
			game:GetService("ReplicatedStorage").VaultIN:FireServer(Player, Val)
		end
	end
	Cooldown = false
end)

server:

local Cooldown = false

RS.VaultIN.OnServerEvent:Connect(function(Player, Val)
	print(Player.leaderstats["Time ⏳"].Value)
	print(Val
.." VALUE")
end)

You don’t need to fire player from client, it make it auto

Could you try changing this part

print(Val
.." VALUE")

to

print(Val)

and tell us the output?

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