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

SF gamepass

Asked by 11 years ago

Ok so I have a Sword Fighting Tournament game and I have a gamepass that give's you a special sword if you have it, well it's like TheGamer101's Krimson Katana game pass. So anyway I was wondering how to make it so that you don't get the sword until the game start's can anyone show me please?

01--------------------
02--| WaitForChild |--
03--------------------
04 
05-- Waits for parent.child to exist, then returns it
06local function WaitForChild(parent, childName)
07    assert(parent, "ERROR: WaitForChild: parent is nil")
08    while not parent:FindFirstChild(childName) do parent.ChildAdded:wait() end
09    return parent[childName]
10end
11 
12-----------------
13--| Variables |--
14-----------------
15 
View all 75 lines...
0
This is my Gamepass script omarz123 5 — 11y

4 answers

Log in to vote
2
Answered by 5 years ago
Ad
Log in to vote
1
Answered by 5 years ago
Log in to vote
0
Answered by
User#2 0
11 years ago

You can use the PlayerHasPass method to check if the user has the game pass, if they do, then clone the sword you want to give to them somewhere where it can be found when the player is put into the game.

Log in to vote
0
Answered by
Nytroz 15
11 years ago

You will also need the ID's of the GamePasses so Roblox knows what GamePass you are checking for in your game. I've started you off with:

1local id = [GamePassIDGoesHere]
2 
3game.Players.PlayerAdded:connect(function(player)
4    if Game:GetService("GamePassService"):PlayerHasPass(player, id) then

Answer this question