Hello, this script should change when a leaderstat is changed. I have a script that changes a users leaderstat based on team and group rank. This script should check the rank and update it if the leaderstat changes on a user and showcase it,
Script:
script.Parent.Text = "" .. game.Players.LocalPlayer.leaderstats.Rank.Value
while wait(1) do
script.Parent.Text = "" .. game.Players.LocalPlayer.leaderstats.Rank.Value
end
No console errors
Noah
March 31, 2022, 5:04pm
2
Are you updating the leader board from the server or from a local script?
Server script. 20 CHARRRSSS
Noah
March 31, 2022, 5:07pm
4
So your 100% certain you change it on the server?
If so, where is the chunk of code that changes the stats?
It 100% changes on the server
local Security = 11200509
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
local leaderstats = Instance.new("Folder",player)
leaderstats.Name = "leaderstats"
local rank = Instance.new("StringValue",leaderstats)
rank.Name = "Rank"
if player.Team == game.Teams["Joining"] then
rank.Value = player:GetRoleInGroup(SCP)
elseif player.Team == game.Teams["Class D"] then
rank.Value = player:GetRoleInGroup(Security)
end
end)
end)```
Noah
March 31, 2022, 5:19pm
7
Alright, when you join the game your player needs to be assigned to a team before this script runs.
Have you made sure that the player is assigned a team before the if statement runs?
The user is assigned a team yes.
The user is automatically teamed Joining while in the menu.
The leaderboard works fully. The issue is with the top script
Toznee_Roblox:
while wait(1) do
sc
Noah
March 31, 2022, 5:44pm
11
Try doing:
print(game.Players.LocalPlayer.leaderstats.Rank.Value)
Then see what it prints.
1 Like
system
Closed
April 7, 2022, 5:45pm
12
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.