I want to make an easy mode gamepass where the kill parts wont kill you if you have it on and I don’t know what the best way to do this would be. can someone explain to me how it would work or how i would code that?
In your script where you kill the player you can add an if statement to check if the player owns the pass using the MarketplaceService.
If you have multiple script that kills the player you can consider using a module script and add here the function that kills the player and checks if he has the pass.
Or better, if your game is based only on parts that kills you when touching like parkour game, you can consider using the CollectionService which enables you to write the code for only 1 script and then it will deal with copying it for other parts, see this:
How can I check to see if the gamepass is enabled? Some kind of string value or something?
local MarketplaceService = game:GetService("MarketplaceService")
local passId = 0 -- gamepass ID
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, passId) then
--Code
end
The easiest way to do what you are asking is to have the server add a ForceField object to the player’s character model. Since the player controls when it’s on, you need to make a setting UI for it, then send it via remote event to the server to process it.
As for the gamepass, you will need to record the fact that it has been purchased in the player’s data. This means that you will need a boolean value to indicate if the gamepass has been purchased or not.
im not trying to check to see if the player has it im trying to make a system where you can toggle it on or off
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.