``Ok so first off how would i add a god mode to this script SO like you NEVER DIE :
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamePassID = 9349044 --Replace this set of numbers with your gamepass id function onPlayerSpawned(player) local hasPass = false local success, message = pcall(function() hasPass = MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID) end) -- The script below is for checking whether or not the player has the gamepass. if not success then warn("Error while checking if player has pass: " .. tostring(message)) return end if hasPass == true then --GOD MODE --END
Hello there. Try using a CharacterAdded
event with an if statement on if the player owns the gamepass. If they do, their MaxHealth and Health get changed to math.huge (infinite).
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") local gamePassID = 9349044 --Replace this set of numbers with your gamepass id local function onPlayerAdded(player) local function onCharacterAdded(character) if MarketplaceService:UserOwnsGamePassAsync(player.userId, gamePassID) then character.MaxHealth = math.huge character.Health = math.huge end end player.CharacterAdded:Connect(onCharacterAdded) end Players.PlayerAdded:Connect(onPlayerAdded)
Please upvote and accept this answer if it helped.
Marked as Duplicate by youtubemasterWOW, kingblaze_1000, and JesseSong
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?