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 » Scripting Helpers
Home Search
 

Re: Uhhh I'm stuck in this game pass

Previous Thread :: Next Thread 
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:02 PM
local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end

game.Players.PlayerAdded:connect(function(plr)
if Authentication(plr) then
for a, v in pairs (tools) do
local wep = a:clone()
wep.Parent = plr




Haven't script in a while. What I am trying to do is to give the player with the gamepass a few extra tools.
But after this, I have no idea what to do.
Could someone help me?

Piggy clasped his hands in apprehension.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:03 PM
"wep.Parent = plr"

Whoops, Isn't it plr.StarterPack?

Piggy clasped his hands in apprehension.
Report Abuse
ForceSky is not online. ForceSky
Joined: 30 Jul 2012
Total Posts: 2379
02 Dec 2013 07:04 PM
wep.Parent = plr.StarterPack

local wep = v:clone()

and put like four ends..
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:06 PM
Forgot connection line, also add it to StarterTools in thr player itself so it doesnt lose vip tools when ded
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:11 PM
@vle

That is smart
thanks

Piggy clasped his hands in apprehension.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:13 PM
No problem, man im on appreciation spree.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:17 PM
v.1 Not working

local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end

game.Players.PlayerAdded:connect(function(plr)
if Authentication(plr) then
for a, v in pairs (tools) do
local wep = v:clone()
wep.Parent = plr.StarterTools
end
end
end)



I think the problem is in the pairs loop.
Shouldnt it be local wep = a[tools]:clone() ???

Piggy clasped his hands in apprehension.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:19 PM
A is equal to nil
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:20 PM
OH FOUND ONE PROBLEM

the tools were not in GamePasses.Tools

Piggy clasped his hands in apprehension.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:23 PM
That didnt work

As the owner, I'm supposed to get the tools, right?

Piggy clasped his hands in apprehension.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:28 PM
You said player and plr
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:31 PM
Should I use player on both functions?

Piggy clasped his hands in apprehension.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
02 Dec 2013 07:32 PM
s4 you're new to this aren't you
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:32 PM
Post v1.1 with connection line please.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:35 PM
@lolb

Indeed, I learned basics 4 months ago. Never went further.

this is what I have

local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end

game.Players.PlayerAdded:connect(function(player)
if Authentication(player) then
for a, v in pairs (tools) do
local wep = v:clone()
wep.Parent = plr.StarterTools
end
end
end)


Piggy clasped his hands in apprehension.
Report Abuse
lolb3 is not online. lolb3
Joined: 16 Jan 2010
Total Posts: 2268
02 Dec 2013 07:40 PM
plr.StarterGear not plr.StarterTools
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:48 PM
Authentication function never launched.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:53 PM
@vle

Working on that

@lolb

Alright, thanks

Piggy clasped his hands in apprehension.
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:55 PM
I doubt this will work...

local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end

game.Players.PlayerAdded:connect(Authentication)
wait()
game.Players.PlayerAdded:connect(function(player)
if Authentication(player) then
for a, v in pairs (tools) do
local wep = v:clone()
wep.Parent = plr.StarterGear
end
end
end)


Im thinking on a way to run Authentication and then decide if give tools or not.

Piggy clasped his hands in apprehension.
Report Abuse
vlekje513 is not online. vlekje513
Joined: 28 Dec 2010
Total Posts: 9057
02 Dec 2013 07:56 PM
You forgot function at the authenticatiion.
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
02 Dec 2013 07:59 PM
local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end

game.Players.PlayerAdded:connect(function(player)
if Authentication(player) then
for a, v in pairs (tools) do
local wep = v:clone()
wep.Parent = plr.StarterTools
end
end
end)

-- New (You're welcome)

local id = 137398215
tools = game.Workspace.GamePasses.Tools
--
game.Players.PlayerAdded:connect(function(pa) -- Player joined the game, wat do?
pa.CharacterAdded:connect(function(ca) -- omg the character spawned, let's check if he has the gamepass!
if game:GetService("GamePassService"):PlayerHasPass(pa, id) then -- omg he might have the gamepass. if he does, continue tool giving :D
for i, v in pairs(tools:GetChildren()) do -- must make loop to go through tools e.e
local w = v:clone() -- make a clone so that the original tools are there
w.Parent = pa.Backpack -- place in backpack so that the tools are readily available. if you place them in the starterpack you have to reset to get them D:
end -- pls end loop
end -- pls end if statement
end) -- pls end CharacterAdded event
end) -- pls end PlayerAdded event
Report Abuse
S4LIN4S is not online. S4LIN4S
Joined: 28 Dec 2008
Total Posts: 29778
02 Dec 2013 07:59 PM
local ID = 137398215
tools = game.Workspace.GamePasses.Tools:GetChildren()

function Authentication(player)
return game:GetService("GamePassService"):PlayerHasPass(player, ID)
end
if Authentication(player) then
for a, v in pairs (tools) do
local wep = v:clone()
wep.Parent = plr.StarterGear
end
end

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

What about that?

Piggy clasped his hands in apprehension.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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