I am not sure what this error means?
18:48:57.291 - Argument 1 missing or nil
18:48:57.292 - Script 'ServerScriptService.Script', Line 15
18:48:57.293 - Stack End
local function WaitForChild(parent, childName)
assert(parent, "ERROR: WaitForChild: parent is nil")
while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
return parent[childName]
end
local ChatStorage = game.Workspace:FindFirstChild("ChatStorage")
local GamePassIdObject = script.N.Value
local GamePassService = game:GetService('GamePassService')
local PlayersService = game:GetService('Players')
game.Players.PlayerAdded:connect(function(plr)
plr.Chatted:connect(function(Message)
local StringVal = Instance.new("StringValue", ChatStorage)
local player = PlayersService:GetPlayerFromCharacter()
if GamePassService:PlayerHasPass(player, GamePassIdObject.Value) then
StringVal.Name = "[VIP]"..plr.Name.." : "..Message
else StringVal.Name = plr.Name.." : "..Message
end
end)
end)
|