What do you want to achieve? Keep it simple and clear!
Basically, What I want to achieve is a Star System. A player collides with a star the leaderboard goes up one, an animation plays, and then the player gets teleported back to the spawn area. That star can only be collected ONCE on a person’s account.
What is the issue? Include screenshots/videos if possible!
It doesn’t exist. (At least to the public)
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I know there are coin systems I can build off of. However, most are just crappy and don’t achieve what I want.
This is pretty good. May I suggest a slight set up change.
Change line 3 in StarHandler to: local Stars = workspace:WaitForChild(“Stars”).
Then move the script to ServerScriptService. Then you would have a type of anti-hacking set up.
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new(“Folder”, Player)
leaderstats.Name = “leaderstats”
leaderstats.Parent = Player
local Coins = Instance.new(“IntValue”, leaderstats)
Coins.Value = 0
Coins.Name = “Coins”
game.Workspace["Placement Star"].Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
wait()
Coins.Value += 1
script.Parent:Destroy()
end
end)
WaitForChild wont change anything because the script is parented to the Stars folder and parenting the script to ServerScriptService will only make it invisible to exploiters that cant do anything to the script anyways
game.Players.PlayerAdded:Connect(function(Player)
local leaderstats = Instance.new(“Folder”, Player)
leaderstats.Name = “leaderstats”
leaderstats.Parent = Player
local Coins = Instance.new(“IntValue”, leaderstats)
Coins.Value = 0
Coins.Name = “Coins”
script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
wait()
Coins.Value += 1
script.Parent:Destroy()
end
end)