Unable to test to see if this script combo works. Does this combination of scripts work? Sorry if its a huge script.
Script one saves the player name in a value, for efficiency. Script two awards the player roblox player points every 100 leaderboard stats.
----------------------SCRIPT 1---------------------------------------
wait(2)
plr = game.Players.LocalPlayer
plrValue = Instance.new("StringValue", script.Parent)
plrValue.Value = plr.Name
plrValue.Name = "PlayerName"
script.Parent.PlayerPointScript.Disabled = false
script:Destroy()
------------------SCRIPT 2----------------------------
wait(2)
pp = game:GetService("PointsService")
function pointsAward()
playerName = script.Parent:FindFirstChild("PlayerName")
plr = game.Players:FindFirstChild(playerName.Value)
stats = plr.leaderstats.Stats
nextPP = plr.leaderstats:FindFirstChild("Next PP")
if stats.Value >= nextPP.Value then
pcall(function()
pp:AwardPoints(plr.userId, 2)
nextPP.Value = nextPP.Value + 100
end)
end
end
function getPP()
awardablePoints = pp:GetAwardablePoints()
if awardablePoints >= 2 then
pointsAward()
end
end
while true do
getPP()
wait(.1)
end |