#help pls

20 messages · Page 1 of 1 (latest)

coarse plume
#

i need a sell button for my game but idk how

cosmic summit
#

try using luau

lethal coyote
#

Sell button?

#

put this script in the button

local but = script.Parent
local plr = game.Players.LocalPlayer

but.MouseButton1Click:Connect(function()
    plr.Cash.Value += plr.Bottle.Value
    plr.Bottle.Value = 0
end)

Here you need to sell bottle for cash

#

This is localscript

grizzled drift
lethal coyote
#

what

#

oh

#

no)

#

alr if you want for server

#
game.Players.PlayerAdded:Connect(function(plr)
    local but = script.Parent


    but.MouseButton1Click:Connect(function()
        plr.Cash.Value += plr.Bottle.Value
        plr.Bottle.Value = 0
    end)
end)
grizzled drift
#

1: server scripts cant run in the GUI?
2: Servers cant detect if the client passed an event

lethal coyote
#

Ok?

#

But why no in local?

grizzled drift
# lethal coyote But why no in local?

Then it will only be the local player that can see the money. Thats why you should make it on the server. Also always check on the server if the player needs to buy anything and if he has enough money on the server.

lethal coyote
#

Yes

#

Wait no

#

I has mini game with value in local

#

But it shows for everyone