generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Simple gamepass script not working

Previous Thread :: Next Thread 
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
30 Jun 2015 05:21 PM
I want it to kill you and set you in the team "CIA" if you own the gamepass 264019915
And if you dont have the gamepass, it prompts the marketplace to bring the gamepass up and ask if u wanna buy
thanks in advance!




OUTPUT;
13:41:24.841 - Players.Player.PlayerGui.ChooseTeam.Frame.CIA.Script:7: 'then' expected near '='


NEW SCRIPT;
local id = 264019915

game.Players.PlayerAdded:connect(function(player)
if not game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then

if
player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:connect(function()
Game:GetService("MarketplaceService"):PromptProductPurchase(player, id)
end
script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
end
script.Parent.MouseButton1Click:connect(onButtonClicked)
print(player.Name .. " has the gamepass and has received birth...")

team = game.Teams["CIA"]

local function onButtonClicked()
player.TeamColor = team.TeamColor
end

script.Parent.MouseButton1Down:connect(onButtonClicked)
end)



fartyburp, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
30 Jun 2015 05:31 PM
b1



fartyburp, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
PositiveDeveloper is not online. PositiveDeveloper
Joined: 21 May 2011
Total Posts: 3608
30 Jun 2015 05:48 PM
b2



fartyburp, Scripting Guru and 3 Year Building Veteran, kiss kiss
Report Abuse
StartDeveloping is not online. StartDeveloping
Joined: 16 Feb 2015
Total Posts: 740
30 Jun 2015 05:49 PM
So much unneeded stuff. Where exactly is this located? Why is there a "player" variable when it's already defining "player"? Why is there a "script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid" when you can just say player.Character.Humanoid? Why is their an if instead of else? Why is there a script.Parent? If you put that in a button, try this instead. MAKE SURE IT'S A LOCALSCRIPT.

wait(1)
local player = game.Players.LocalPlayer
repeat wait() until player.Character
repeat wait() until player.Character.Humanoid
local id = 264019915

if not game:GetService("MarketplaceService"):PlayerOwnsAsset(player, id) then
script.Parent.MouseButton1Click:connect(function()
game:GetService("MarketplaceService"):PromptProductPurchase(player, id)
player.Character.Humanoid.Health = 0
end)
else
script.Parent.MouseButton1Click:connect(function()
print(player.Name .. " has the gamepass and has received birth...")
local team = game.Teams["CIA"]
player.TeamColor = team.TeamColor
end)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image