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)