local vipPass = 231935192
local ultraVipPass = 231935475
game.Players.PlayerAdded:connect(function(player)
if game.GamePassService:PlayerHasPass(player, ultraVipPass) then
local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + 10000
end
player.CharacterAdded:connect(function(char)
if char:WaitForChild("Humanoid") then
char.Humanoid.MaxHealth = 200
char.Humanoid.Health = 200
char.Humanoid.WalkSpeed = char.Humanoid.WalkSpeed + 4
end
end)
elseif game.GamePassService:PlayerHasPass(player,vipPass) then
local cashmoney = game.ServerStorage.MoneyStorage:WaitForChild(player.Name)
if cashmoney then
cashmoney.Value = cashmoney.Value + 5000
end
player.CharacterAdded:connect(function(char)
if char:WaitForChild("Humanoid") then
char.Humanoid.MaxHealth = 150
char.Humanoid.Health = 150
end
end)
end
end)
I have this script inside ServerScriptStorage and I was whenever a VIP joins a server they get all the perks. It works, but if you leave and rejoin the same server then you don't get these perks. How can I make it so you get these perks every time you enter a new server as well as the same server you were in a few minutes ago?

10 comments
it says ms is unknown global?
and another thing. I have two VIPs, I only used one. How can I get it to work so it works for both a VIP and UltraVIP. I have editted my answer with my original with both vips.
Sorry I didn't define ms.
Should my thing actually work without any problems? I think its cause of the moneystorage in ServerStorage, but idk. I just want if you leave and rejoin that same server you get the cash and health again
I'm not going to help with adding another VIP to it since it's not your original question. This code should work perfectly.. what errors are you getting?
there are no errors
I have one problem though, when you join , your maxhealth changes to 150, BUT your health dosent, so you start of with half your health and have to wait till it gets to 150
What do you mean 'wait' until it gets to 150? It should change with little to no yeild from when the character spawn
well the character spawns with 100 health and 150 max health, so the player has to wait for it to load
Sorry, it's because I defined the health before the MaxHealth was defined. I edited it so it should work now(: