Hello developers!
I calls a server event with two values!
I don’t know how to say i just attach scripts
Local Script:
script.Parent.MouseButton1Click:Connect(function()
local replic = game:GetService("ReplicatedStorage").Events
local player = game:GetService("Players").LocalPlayer
local value = player.Upgrades.upClick.Value + 100000 * 2
print(value)
replic.UpgradeClicks:FireServer(player.Name, value) -- 1: player, 2: cost.
end)
Script:
local replic = game:GetService("ReplicatedStorage").Events
replic.UpgradeClicks.OnServerEvent:Connect(function(player, cost)
print(player) -- 200001
wait(10)
print(cost) -- ScaryLedP
--[[if player.leaderstat.Points.Value > cost or player.leaderstat.Points.Value == cost then
player.Upgrades.upClick.Value += 1
--print(cost)
player.leaderstat.Points.Value -= cost
else
return warn("unsuccessfull")
end
--]]
end)
