This is the First Simulator that I have ever made and I am confused on how to add a 2x Strength script and where to put it? Do I just make a separate script for a regular script or local script and it goes into server script service?
local MarketpalceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") if MarketpalceService:UserOwnsGamePassAsync(Players:GetUserIdFromNameAsync(object.Parent.Name), 7142533) then print("User owns the 2X Gamepass.") print("Strength: "..Strength * 2) else print("User does not own the 2X Gamepass.") print("Strength: " ..Strength) end
You can put it wherever you want, but to avoid hackers, make the check for the gamepass on the server: Check if the player owns the gamepass at the beginning of the game and make/update a variable in game called hasDoubleStatsPass which the game can check if the player has when they do something in game to get stats.
local MarketplaceService = game:GetService("MarketplaceService") local Players = game:GetService("Players") playerId= Players:GetUserIdFromNameAsync(object.Parent.Name) if(MarketplaceService:UserOwnsGamePassAsync(playerId,7142533))then print("User owns the 2X Gamepass.") print("Strength: "..Strength * 2) else print("User does not own the 2X Gamepass.") print("Strength: " ..Strength) end