Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I award 5 Player Points to this player? (HELP)

Asked by
Relatch 550 Moderation Voter
10 years ago

This code/script shows a gui when you get your first kill. Now, how would I award Player Points(5) to this player?

local plr = game.Players.LocalPlayer

moved = false

while true do
    if moved == false and plr.leaderstats.Kills.Value >= 1 then
        moved = true
        plr.PlayerGui.nicekills.MainFrame.Background.TextLabel:TweenPosition(UDim2.new(0, 0, 4, 0), "Out", "Bounce", 2.5)
        wait(7)
        plr.PlayerGui.nicekills.MainFrame.Background.TextLabel:TweenPosition(UDim2.new(0, 0, 10, 0), "Out", "Bounce", 2.5)
    end
    wait(1)
end

1 answer

Log in to vote
1
Answered by
Merely 2122 Moderation Voter Community Moderator
10 years ago

You need to use the PointsService:AwardPoints method. However, it can only be used from a local script. You should change the script so that it runs as a server script in ServerScriptService.

http://wiki.roblox.com/index.php?title=API:Class/PointsService/AwardPoints

Ad

Answer this question