Okay, so here is my script:

local SSS = game:GetService('ServerScriptService'); 
local player = game:GetService("Players");

player.PlayerAdded:Connect(function(plr)
    plr.chatted:connect(function(msg)
        if msg:lower() == '/ranktagoff' then
		 game.Workspace[plr.Name].Head.RankTags:Destroy()
        end
    end)
end)

player.PlayerAdded:Connect(function(plr)
    plr.chatted:connect(function(msg)
        if msg:lower() == '/ranktagon' then
		 game.ServerScriptService.TimelessScriptsRewrite.RankTagSystem:FindFirstChild("RankTags"):Clone().Parent = game.Workspace[plr.Name].Head
        end
    end)
end)

The error is:

game.ServerScriptService.TimelessScriptsRewrite.RankTagSystem
:FindFirstChild("RankTags"):Clone().Parent = game.Workspace[plr.Name].Head

Whenever I try to run it, the error message says:

ServerScriptService.AquaScripts.RankTagOnOff:15: attempt to index a nil value 15:55:39.895 - Stack Begin.

Please help me fix this. Thank you very much!

4 comments

0

TimelessScriptsRewrite is not a valid member of ServerScriptService, just like the error implies.

0

Also, why do you have two separate chatted and playeradded events, when you only need one of each

0

Also, why do you have two separate chatted and playeradded events, when you only need one of each

0

do plr.Character.Head