This is what the tool gamepass is like: When the gamepass is bought, the player that owns it owns a tool model (not ROBLOX gear) in the game.
This is the script that I tried:
if game:GetService('GamePassService'):PlayerHasPass() then game.ServerStorage.VoidSword:Clone end
I know, there are many things wrong but this is my first time making a scripted game.
**Problem: **
You seemed to not fill in the parameters
of the :PlayerHasPass()
. I also don't know how you want the script to give the player the tool whether it be upon joining or not so I did that. You also seem to be doing the cloning process wrong.
Solution:
I just added the parameters
in their rightful place and added a PlayerAdded
event. I fixed your cloning problem.
Code:
local id = 0000000 --Change this to the gamepass id you want game.Players.PlayerAdded:connect(function(player) if Game:GetService("GamePassService"):PlayerHasPass(player, id) then --Added the Parameters local clone = game.ServerStorage.VoidSword:Clone() -- You need the parenthesis and to determine where it will be parented to clone.Parent = player:WaitForChild("Backpack") --In this game the player's Backpack print(player.Name .. " has the game pass!") else print(player.Name .. " doesn't have the game pass...") end end)
If you have questions don't be afraid to ask and I will be glad to answer. If this helped you don't forget to accept my answer.