Roblox Forum banner

Add PlayerHasPass to script

838 views 5 replies 2 participants last post by  Ike  
#1 ·
Hello,
I have a script here but i don't know how to add PlayerHasPass to it.
Here's the script
------------------------

function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller")--<--Put team colour there.
end


script.Parent.MouseButton1Down:connect(Click)

------------------------

Please help,
Wolfornator.
(if you need my discord: )
 
#3 ·
Okay

it dosen't work
Is the script right?

---------------------

function Click(mouse)
game:GetService("GamePassService"):playerHasPass(4852067)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller")
end

script.Parent.MouseButton1Down:connect(Click)

---------------------

i also tried

--------------------------

game:GetService("GamePassService"):playerHasPass(4852067)
function Click(mouse)
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller")
end

script.Parent.MouseButton1Down:connect(Click)

--------------------------
 
#4 ·
function Click(mouse)
if game:GetService("GamePassService"):playerHasPass(player, 4852067) then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller")
end
end


script.Parent.MouseButton1Down:connect(Click)

If this is a local script you can add at the first line: local player = game.Players.LocalPlayer, if it isn't then you would have to use script.Parent.Parent.Parent.Parent.Parent as what i put in as "player" in the :playerHasPass() part
 
#5 ·
Dosen't work.

________________

function Click(mouse)
if game:GetService("GamePassService"):playerHasPass(player, 4852067) then
script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("New Yeller")
end
end

script.Parent.MouseButton1Down:connect(Click)
________________

It's a script