Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local car1 = game.ReplicatedStorage.Cars.BasicCar
- local button = script.Parent.BasicCar
- local leaderstats = player:WaitForChild("leaderstats").Cash
- local Character = player.Character
- price1 = 50 -- 50 es el precio del primer auto
- debounce = false
- button.MouseButton1Click:connect(function()
- local CloneVehicle1 = car1:Clone()
- local frame = script.Parent
- if not debounce then
- debounce = true
- if price1 == 50 then
- if leaderstats.Value < price1 then
- print("No tienes dinero")
- end
- if leaderstats.Value >= price1 then
- print("Auto Comprado")
- CloneVehicle1.Parent = workspace
- CloneVehicle1.PrimaryPart = CloneVehicle1.Main
- CloneVehicle1:SetPrimaryPartCFrame(Character.Head.CFrame)
- CloneVehicle1:MakeJoints()
- leaderstats.Value = leaderstats.Value - price1
- frame.Visible = false
- end
- end
- debounce = false
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement