Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local plr = game.Players.LocalPlayer
- local replicatedstorage = game:GetService('ReplicatedStorage')
- script.Parent.MouseButton1Click:connect(function()
- if plr.Backpack:FindFirstChild('GravityCoil') or plr.StarterGear:FindFirstChild('GravityCoil') or game.Workspace[plr.Name]:FindFirstChild('GravityCoil') then
- script.Parent.Parent.TextLabel.Text = 'You have already bought this item!'
- wait(3)
- script.Parent.Parent.TextLabel.Text = 'Welcome to my shop'
- else
- if plr.leaderstats.Points.Value >= 30 then
- replicatedstorage.GravityCoil:Clone().Parent = plr.Backpack
- replicatedstorage.GravityCoil:Clone().Parent = plr.StarterGear
- else --
- local cashrequired = 30 - plr.leaderstats.Points.Value
- script.Parent.Parent.TextLabel.Text = 'You need '..cashrequired..' more money to buy this item!'
- wait(3)
- script.Parent.Parent.TextLabel.Text = 'Welcome to my shop'
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement