Hi, Im trying to make a Health gain speed gamepass heres the script
local MarketPlaceService = game:GetService(“MarketplaceService”)
local GamepassId = 14985258
local Players = game:GetService(“Players”)
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
while true do wait(1)
Character:WaitForChild(“Humanoid”).Health = Player.Humanoid.Health + 5
end
end
end)
end)
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 14985258
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
while true do wait(1)
Character:WaitForChild("Humanoid").Health = Player.Humanoid.Health + 5
end
end
end)
end)
local MarketPlaceService = game:GetService("MarketplaceService")
local GamepassId = 5735397
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
if MarketPlaceService:UserOwnsGamePassAsync(Player.UserId, GamepassId) then
while true do wait(1)
local Humanoid = Character:WaitForChild("Humanoid")
if Humanoid ~= nil then
Humanoid.MaxHealth = Humanoid.MaxHealth + 5
Humanoid.Health = Humanoid.Health + 5
end
end
end
end)
end)
In this it changes their health every few seconds, if you just want it to be +5, then remove the loop. I was wondering what was wrong then I realized that the MaxHealth was just 100 and wasn’t changing.
I think that is likely because of the regen rate. If your health is 1000, you are going to heal 10 health every second up until you reach your max. Or 500, 5 health until you reach full health. So it heals faster than you can do damage.
I guess you’d have to modify health regen. There is a health script in the player. So you could delete that and clone your makeshift Health Script and put it in the Character. But depending on what you want for the gamepass you could just remove the loop to make it so that they just get 5+ health.