My script inside of a part with a int value called stars
starcount = script.Parent.Stars.Value
script.Parent.Touched:Connect(function(hit)
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if player then
player:FindFirstChild(“WantedLevel”).Value = starcount
end
end)
the script in server script service called Wanted Board:
local Players = game:GetService(“Players”)
Players.PlayerAdded:Connect(function(player)
if not player:FindFirstChild(“WantedLevel”) then
local int = Instance.new (“IntValue”,player)
int.Name = “WantedLevel”
end
end)
my script inside of a gui titled wanted gui with a frame with star images titled star1 thru 5:
i tested the game but i see no code that links the wanted level to the displayname of the player.
what you want to do is.
when a player joins… wait for the character.
when the character is there save the displayname (character.humanoid.displayname)
if the wanted level in players change. so needs the displayname to storedname+number of
if a player dies or resets the character the new character alsow needs the displayname set
starcount = script.Parent.Stars.Value
script.Parent.Touched:Connect(function(hit)
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if player then
player:FindFirstChild(“WantedLevel”).Value = starcount
end
end)
--the script in server script service called Wanted Board:
local Players = game:GetService(“Players”)
Players.PlayerAdded:Connect(function(player)
if not player:FindFirstChild(“WantedLevel”) then
local int = Instance.new (“IntValue”,player)
int.Name = “WantedLevel”
end
end)
--[[my script inside of a gui titled wanted gui with a frame with star images titled star1 thru 5:]]
plr = game.Players.LocalPlayer
wantedLevel = plr:FindFirstChild(“WantedLevel”)
wantedFrame = plr.PlayerGui:FindFirstChild(“WantedGUI”).Frame
wantedLevel.Changed:Connect(function()
for i,v in pairs (wantedFrame:GetChildren()) do
v.Visible = false
end
for count = 1, wantedLevel.Value do
wantedFrame:FindFirstChild("Star"..count).Visible = true
end
end)