I have this script in a GUI that detects if a player owns a Gamepass, it then deletes the script. However, every time someone joins, some appear as Spawn, yet they don't own the gamepass! Anyone see an issue with the script?
passid = 158752762 local GamePassService = game:GetService("GamePassService") function respawned(char) local player = game.Players:FindFirstChild(char.Name) if char:FindFirstChild("Head") ~= nil then wait (0.01) if GamePassService:PlayerHasPass(player, passid) then script.Parent.Parent.Spawn.Visible = true wait() script.Parent:remove() else end end end game.Workspace.ChildAdded:connect(respawned)
Cheers in advanced,
Michael
passid = 158752762 local GamePassService = game:GetService("GamePassService") function respawned(char) local player = game.Players:FindFirstChild(char.Name) if GamePassService:PlayerHasPass(player, passid) then script.Parent.Parent.Spawn.Visible = true else script.Parent:remove() wait(.01) end end game.Workspace.ChildAdded:connect(respawned)
script.Parent:remove() was located wrong, it is supposed to be after else, so if they dont have the passid it gets removed.