I need a script where if you have DON'T have a game pass then it removes the "Health" script within your character that you get every time you spawn (game.Workspace.CHARACTERSNAME.Health). at this script does is allows your character to regenerate lost health over time. However, if they DO have the game pass then it does NOT remove this script.
How do I do this?
My Attempt:
gp = 162631986
Game.Players.PlayerAdded:connect(function(Player)
if Game:GetService("GamePassService"):PlayerHasPass(Player, gp) then
end
else game.Workspace.Player.Health:remove()
end
Attempt Two:
gp = 162631986
Game.Players.PlayerAdded:connect(function(Player)
if Game:GetService("GamePassService"):PlayerHasPass(Player, gp) then
return
else game.Workspace.Player.Health:remove()
end
end)
Attempt Three:
gp = 162631986
wait(1)
Game.Players.PlayerAdded:connect(function(Player)
if Game:GetService("GamePassService"):PlayerHasPass(Player, gp) then
return end
p = Player.Name
game.Workspace[p].Health:remove()
end)
(Sorry, first time here. Didn't know the script attempt was required)

4 comments
Well yes, you see...I scripted that part already. It is the executing function part that is not working...
There, sorry for not providing the attempt, I added it.
This should work.
It is still healing even if I don't have the game pass.