You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I want to make a system where you can purchase colora from the store
- What is the issue? Include screenshots / videos if possible!
The client has the price as 300 however the server recieves it as “Red” however I did not make anything equal to each other and there really seems to be no correlation.
As you can see it prints as “300” on the client but “Red” on the server.
Local script:
local price = script.Parent.Parent.price.Text
local TEXT = script.Parent:FindFirstChild("TextLabel").Text
script.Parent.MouseButton1Up:Connect(function()
local plrcoins = plr.leaderstats.Coins
if IsBought == true then
print("true")
part.Color = script.Parent.BackgroundColor
else
print("false")
purchase.Text = "Confirm Purchase of "..TEXT.." for ".. "300".."?"
confirmation.Visible = true
confirmation.Yes.MouseButton1Up:Connect(function()
if plrcoins.Value >= tonumber(price) then
event:FireServer(TEXT, key)
confirmation.Visible = false
print(price)
valincrease:FireServer(price)
print(price.."afer")
else
print("not enough coins")
end
end)
confirmation.No.MouseButton1Up:Connect(function()
confirmation.Visible = false
confirmation.TextLabel.Text = "Confirm order of..."
end)
end
end)
Server Script:
Purchase.OnServerEvent:Connect(function(plr, price)
print("ok")
local coins = plr.leaderstats.Coins
print(coins.Value)
print(price)
coins.Value -= tonumber(price)
end)```