I'm trying to use a remote function to pass over two player values to be saved to a lead board database. I can't get the remote event to send the values or something, but the code doesn't spit out any errors. Could someone please help me out.
Local Script:
local button = script.Parent
local gui = script.Parent.Parent.Parent
local text = script.Parent.Parent.TextBox
local a = text.Selling
local player = script.Parent.Parent.Parent.Parent.Parent
local stats = player:WaitForChild("LeaderStats")
local b = stats:WaitForChild("Coins")
local c = stats:WaitForChild("Diamonds")
text.Changed:Connect(function()
b.Value = text.Text
end)
button.MouseButton1Down:Connect(function()
if b.Value >= a.Value then
b.Value = b.Value - a.Value
c.Value = c.Value + a.Value * 1.5
game.ReplicatedStorage.ServerHandlers.SellEvent:FireServer(player, b, c)
print(player.Name.."|Diamonds: "..c.Value.."|Coins: "..b.Value)
end
end)
Server Script:
--[[There is more to this script, but it's unrelated to the problem]]
game.ReplicatedStorage.ServerHandlers.SellEvent.OnServerEvent:Connect(function(player)
local stats = player:WaitForChild("LeaderStats")
local b = stats.Coins
local c = stats.Diamonds
print(player.Name.."|Diamonds: "..c.Value.."|Coins: "..b.Value)
end)
Currently the script in the prints show me the local stats and the server stats after the trade is completed. I'm not sure what's going on here.

1 comment
I can't see the entire script past :Connect, so can you please clear it up?