How would I make a ship spawner that will take away Coins when clicked?
Asked by
3 years ago Edited 3 years ago
I am trying to make a ship spawner but I want it to take away Coins when clicked here is my script:
~~~~~~~~~~~~~~~~~
local Coins = game.Players:WaitForChild("leaderstats.Coins")
local ServerStorage = game:GetService("ServerStorage")
local detector = workspace["Regen Speedboat 50 Coins"]
local debounce = false
script.Parent.ClickDetector.MouseClick:Connect(function()
if debounce then return end
debounce = true
print("I was clicked!")
local Copy = ServerStorage:FindFirstChild("SpeedBoat"):Clone()
Copy.Parent = workspace
Copy.Name = "Speedone"
Copy:MoveTo(Vector3.new(-14, 2.5, -344))
wait(6)
debounce = false
end)
~~~~~~~~~~~~~~~~~