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

Roblox Studio: Team GUI OK! Gamepass Team Change ERROR! Help?

Asked by 6 years ago

I need help, i tried to make a team change GUI, and it worked..But i need to set a Team that you can join only with Gamepass. This is the script:

local Player = game.Players.Name

script.Parent.Parent.Scegli.MouseButton1Click:connect(function()

if game:GetService("GamePassService"):PlayerHasPass(Player, 1064727264) then 

    game.Players[Player].TeamColor = BrickColor.new("Teal")

end
end)

This is the error:

13:36:03.153 - Death Note GAME.rbxl was auto-saved (x2)
13:36:06.215 - Unable to cast value to Object
13:36:06.215 - Stack Begin
13:36:06.216 - Script 'Players.EraserHead24.PlayerGui.Scegli.L.Scegli.LocalScript', Line 4
13:36:06.216 - Stack End

Answer this question