I cannot find any tutorials on how to make a star collecting system like adventure forward and roblox quest. Can anyone help me.
You would need to make a .Touched event. If you are putting the script inside the star, It would be like.
script.Parent.Touched:Connect(function (hit) script.Parent:Destroy --Your script to award the player end)
Whenever you touch the star it will get destroyed, then you can award the player however you'd like, I don't know how you are gonna so I did not include it, Nor I can spoon feed. You would need to have a tween CFrame animation if you wanna make it go up and down and swirl in the air.
Add a script
inside ServerScriptService
then put the code:
for _, Star in pairs(game:GetDescendants()) do -- Checks for every object inside the workspace if Star:IsA("Part") then -- checks if its a part (change this if your star is Union to "UnionOperation") Star.Touched:Connect(function(hit) -- Checks if something hits the object if Star.Name == "Star" then -- checks the name of the object if hit.Parent:FindFirstChild("Humanoid") then -- finds humanoid inside the touched.Parent local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- variable for player local leaderboard = player:WaitForChild("leaderboard") -- variable for leaderboared local star = leaderboard:WaitForChild("Star") -- variable for star (change this if ur Star leaderstat is different) star.Value = star.Value + 1 -- adds value (Change 1 to everything you want) game.Debris:AddItem(Star, 0) -- destroy the star end end end) end end
the explanations are inside the code. If it works tell me even if it doesn't so I can help you