Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i add god mode with a gamepass i have a example ?

Asked by 4 years ago

I need to add god mode but a gamepass\

**local MarketPlaceService = game:GetService("MarketPlaceService ")

local PlayerBoughtThisGamePass =  MarketPlaceService.UserOwnsGamePassAsync(Userid, GamePassiD)

if PlayerBoughtThisGamePass then

  --THE GOD MODE

end**
0
You can set the players health to infinite like, game.Players:GetPlayerByUserId(Userid).Character.Humanoid.Health = math.huge questionthonk 36 — 4y
0
Where do i put that UnrealSaltyYouTube -12 — 4y
0
The bit where you have --THE GOD MODE questionthonk 36 — 4y
0
Do i change anything UnrealSaltyYouTube -12 — 4y
View all comments (4 more)
0
no you just put that code in there questionthonk 36 — 4y
0
Because the script is underlining user id and gamepass id and i think it wrong could this work instead? : https://scriptinghelpers.org/questions/10875/how-to-check-if-a-player-has-a-gamepass-solved UnrealSaltyYouTube -12 — 4y
0
Well thats because id assumed youd had gamepassid and userid referenced :3 questionthonk 36 — 4y
0
Then can i use the link i send and replace the print value to what you said ~ UnrealSaltyYouTube -12 — 4y

2 answers

Log in to vote
0
Answered by
oilkas 364 Moderation Voter
4 years ago

This should work:

game.Players.PlayerAdded:Connect(function(plr)
    local PlayerHassPass = game:GetService("MarketPlaceService").UserOwnsGamePassAsync(plr.UserId, Gamepassidhere)
    if PlayerHasPass then
        plr.CharacterAdded:Connect(function(char)
            local hum = char:WaitForChild("Humanoid")
            hum.MaxHealth = math.huge
            hum.Health = MaxHealth
        end)
    end
end)
0
Dont work UnrealSaltyYouTube -12 — 4y
0
did u replace the Gamepassidhere bit questionthonk 36 — 4y
0
also replace the . before UserOwnsGamePassAsync with a : questionthonk 36 — 4y
0
I did the first one but idk about the second one? UnrealSaltyYouTube -12 — 4y
View all comments (2 more)
0
NOO WORK UnrealSaltyYouTube -12 — 4y
0
Use "hum.Health = hum.MaxHealth". youtubemasterWOW 2741 — 4y
Ad
Log in to vote
0
Answered by
MattVSNNL 620 Moderation Voter
4 years ago
Edited 4 years ago

At MarketPlaceService you did .UserOwnsGamePassAsync it is :UserOwnsGamePassAsync

local MarketPlaceService = game:GetService("MarketPlaceService ")

local PlayerBoughtThisGamePass =  MarketPlaceService:UserOwnsGamePassAsync(Userid, GamePassiD)

if PlayerBoughtThisGamePass then

  --THE GOD MODE

end

Answer this question