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
 

Re: Need Help With A Gamepass Script

Previous Thread :: Next Thread 
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 02:53 PM
Hello! I am making a game, and I want to add a radio, that you have to buy with a gamepass. I can't seem to get a script where if you have a gamepass it gives you the radio.

I have this script, which works: game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) require(game:GetService("ReplicatedStorage"):WaitForChild("GiveRadio"))(player) end) end)


That script gives the radio to anyone who joins. Could someone help me implement a gamepass script into this? Thanks!
Report Abuse
ChiefDelta is not online. ChiefDelta
Joined: 05 Nov 2010
Total Posts: 13071
05 Jan 2015 02:54 PM
there's no point using GetService on ReplicatedStorage.

PlayerHasPass
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 02:57 PM
There is another script in replicatedStorage which makes it so the radio gets put onto your back. I am trying to do a Mad Murderer/Twisted Murderer radio.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:00 PM
local passService = game.GamePassService -- i dont think you have to use getservice on this

game.Players.PlayerAdded:connect(function(player)

player.CharacterAdded:connect(function(char)

if passService:PlayerHasPass(player, PassID) then

-- effect

end

end)

end)

-- should work
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:04 PM
I am a noob at scripting. My friend made the script to give the radio, but that is where it gives it to anyone who joins the game. I don't know how to implement the code that I put up there into your script. I am sorry if this is causing any trouble D:


Code that needs to implemented:
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) require(game:GetService("ReplicatedStorage"):WaitForChild("GiveRadio"))(player) end) end)


I don't know if the code up there needs to be scratched for the gamepass to work or not.
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:05 PM
DO I put the ID where it says ID in the ( )?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:11 PM
yes you put the game pass ID there
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:13 PM
Should it look like this?

local passService = game.GamePassService -- i dont think you have to use getservice on this

game.Players.PlayerAdded:connect(function(player)

player.CharacterAdded:connect(function(char)

if passService:PlayerHasPass(player, PassID) then

game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(char) require(game:GetService("ReplicatedStorage"):WaitForChild("GiveRadio"))(player)

-- effect

end

end)

end)
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:15 PM
One I posted above does not work...

I am using this radio: http://www.roblox.com/Twister-murderer-Radio-item?id=188622268

Maybe that will be helpful to you?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:19 PM
no...


local passService = game.GamePassService -- i dont think you have to use getservice on this
local radio = game.ReplicatedStorage.Radio

game.Players.PlayerAdded:connect(function(player)

if passService:PlayerHasPass(player, PassID) then

local c = radio:Clone()
c.Parent = player.StarterGear

end

end)
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:22 PM
you should NEVER copy parts of one script into another
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:23 PM
Ok, that script did not work :/ I'm not sure if the link of the radio would help you or not. It is a model, and not a gear. The radio puts up a GUI and puts a radio model on your back.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:29 PM
first where did you test this? studios?

second i had no idea there was a Gui involved, that will take some changes to the script
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:32 PM
I put the script in studio, and then joined the game with Roblox player
Report Abuse
MeNameIsKaleb is not online. MeNameIsKaleb
Joined: 17 Oct 2014
Total Posts: 50
05 Jan 2015 03:39 PM
Nevermind. The radio is broken.

I wanted a radio that puts a radio on your back, you put in an ID for audio, and then everyone around you can hear it. Just like the radios on Mad Murderer and Twisted Murderer.
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
05 Jan 2015 03:41 PM
ether way
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