I made a gamepass that if you buy it you get a teleport gui. For some reason tho it only lasts 1 life. If I die it goes away. I need it to stay forever tho. Here is script:
local id = 6341684
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:connect(function(char)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.Players[char.Name].UserId, id) then
local ui = script.Teleport:Clone()
ui.Parent = plr.PlayerGui
end
end)
end)
I put the gui inside of this script and it last 1 life tho. I need it to last forever. Please help.
Make a script containing something like this inside a server script
Character.Humanoid.Died:Connect(function() if game:GetService(“MarketplaceService”):UserOwnsGamePassAsync(game.Players[[char.Name](http://char.name/)].UserId, 6341684) then RemoteEventPathHere.RemoteEvent:FireClient(game.Players:GetPlayerFromCharacter(Character)) end end
and then make a local script in StarterGui containing something like this
local plr = game.Players.LocalPlayer RemoteEventPathHere.RemoteEvent.OnClientEvent(function() local ui = script.Teleport:Clone() ui.Parent = plr.PlayerGui end)