Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local pointPart = script.Parent
- --local storage = game:GetService("ServerStorage")
- -- Gives some points
- local blue = Color3.fromRGB(0, 0, 255)
- -- Gives more points
- local green = Color3.fromRGB(0, 255, 0)
- -- Makes players lose points
- local red = Color3.fromRGB(255 ,0, 0)
- -- gold given to players
- local smallPoints = 10
- local largePoints = 50
- local losePoints = 100
- local Players = game:GetService("Players")
- local function givePoints(player)
- local currentColor = pointPart.Color
- local playerStats = player:WaitForChild("leaderstats")
- local playerPoints = playerStats:WaitForChild("Points")
- -- Gives player gold based on the color of the part
- if currentColor == blue then
- playerPoints.Value = playerPoints.Value + smallPoints
- elseif currentColor == green then
- playerPoints.Value = playerPoints.Value + largePoints
- else
- playerPoints.Value = playerPoints.Value - losePoints
- end
- -- Destroy the part, wait a second, and thne destroy the particle
- pointPart:Destroy()
- -- Creates a sparkles effect and destroys it
- local playerCharacter = player.Character
- local particle = Instance.new("ParticleEmitter")
- particle.Color = ColorSequence.new(currentColor)
- particle.Parent = playerCharacter:WaitForChild("Head")
- wait(1)
- particle:Destroy()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement