0 views0 copies0 likes
Collectible Coins with Timed Return
Universal script
Copy it, then test it in your own Studio place.
Script code
17 lines · 0.6 KBlocal Players = game:GetService("Players")for _, coin in workspace:WaitForChild("CoinPickups"):GetChildren() do if not coin:IsA("BasePart") then continue end local enabled = true local opacity = coin.Transparency coin.Touched:Connect(function(hit) local character = hit:FindFirstAncestorOfClass("Model") local player = character and Players:GetPlayerFromCharacter(character) if not enabled or not player then return end enabled = false player:SetAttribute("Coins", (player:GetAttribute("Coins") or 0) + 1) coin.Transparency = 1 task.wait(6) coin.Transparency = opacity-- …open Get script for the full sourceAbout this script
Put anchored coin parts in a folder named Workspace.CoinPickups. The script awards one point to a player's Coins attribute per pickup, hides the collected coin, then restores it after six seconds for everyone. One availability flag per coin prevents double payouts from overlapping touches. Connect a UI to the Coins attribute if you want to show the session balance.
Log in to leave a comment.
No comments yet
Be the first to share your thoughts!
Comments
Share what works, ask questions, or report an issue.