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

Adding a x2 Strength Gamepass?

Asked by 4 years ago
Edited by theking48989987 4 years ago

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
0
We'll looking at how we don't know where the value is located and we need more information so can't help you there bud. VitroxVox 884 — 4y

1 answer

Log in to vote
0
Answered by
royaltoe 5144 Moderation Voter Community Moderator
4 years ago

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
0
It doesn't work lucyy! :( Techo_Dev 2 — 4y
0
any errors? royaltoe 5144 — 4y
Ad

Answer this question