player = script.Parent.Parent.Parent.Parent.Parent.Parent
gold = player.leaderstats.Cash
cost = script.Parent.Cost.Value
getItem = game.Lighting.ErtYhop.Listed.ChezBurger
function buy()
if gold.Value >= cost then
gold.Value = gold.Value - cost
local a = getItem:clone()
a.Parent = player.Backpack
cost = 0 -- idk here
wait(1)
end
script.Parent.ImageTransparency = 0.9
script.Parent.ImageColor3 = 21, 158, 165
wait(1)
script.Parent.ImageTransparency = 0.3
end
script.Parent.MouseButton1Down:connect(buy
) Hey Ho ! I wanna make this script to change value of 'cost' to 0 cost = 0 - idk here
Can You help me ? I'm new to lua :P

3 comments
u gotta do currency exchanges from the server, learn remotevents or attempt to turn off filtering enabled
u gotta do currency exchanges from the server, learn remotevents or attempt to turn off filtering enabled
dont create new memory object .. instead just assign instance cost = script.Parent.Cost and then add to your code cost.Value