|
| 14 May 2014 04:44 PM |
local passid = 93044881 local tools = {"Illumina"} local GamePassService = Game:GetService('GamePassService') game.Players.PlayerAdded:connect(function(player) repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear if GamePassService:PlayerHasPass(player, passid) then for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear end end end)
I Tried twice but failed trying to make it work when I click a button
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 14 May 2014 05:33 PM |
| Put ur tool in Lighting and name it exactly the same ( INclUdINg capITAls ) as in the table. |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 08:01 PM |
Yes I did that already
I want to make it activate when I click a gui button
I am not exactly sure where to put
function sword()
end script.Parent.MouseButton1Down(sword)
In the script
|
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 14 May 2014 08:48 PM |
script.Parent.MouseButton1Down:connect(function(sword) local passid = 93044881 local tools = {"Illumina"} local GamePassService = Game:GetService('GamePassService') game.Players.PlayerAdded:connect(function(player) repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear if GamePassService:PlayerHasPass(player, passid) then for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear end end end) end) |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 08:53 PM |
does not work sidekick
I put the script in startergui > screengui > textbutton
and when I click the button it does nothing in online mode and solo |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 14 May 2014 08:59 PM |
| Give it a try and tell me what happens. |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 09:01 PM |
tried It did not work either :/
|
|
|
| Report Abuse |
|
|
|
| 14 May 2014 09:03 PM |
oops, try this. if it doesnt work i'm not sure what the problem is
local passid = 93044881 local tools = {"Illumina"} local GamePassService = Game:GetService('GamePassService')
script.Parent.MouseButton1Down:connect(function(sword)
repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear if GamePassService:PlayerHasPass(player, passid) then for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear end end end)
|
|
|
| Report Abuse |
|
|
|
| 14 May 2014 09:14 PM |
nope did not work for both types
it works fine in workplace without the script.Parent.MouseButton1Down:connect
I just wanted them to click the gui and they would get the sword |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 09:16 PM |
-- THIS SHOULD BE IN A LOCAL SCRIPTTTTTT local tools = {"Illumina"} local player = game.Players.LocalPlayer
script.Parent.MouseButton1Down:connect(function(hopefullythisworks)
repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear end end end) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 May 2014 09:18 PM |
That should work if and only if script.Parent is a TextButton, and the tool exists. Remove the FindFirstChild or actually check if the child is nil.
game.Lighting[tools[i]]:Clone().Parent = player.Backpack game.Lighting[tools[i]]:Clone().Parent = player.StarterGear |
|
|
| Report Abuse |
|
|
|
| 14 May 2014 09:23 PM |
| Nice 20000th post and thanks |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 15 May 2014 03:32 PM |
| script.Parent.MouseButton1Click:connect() |
|
|
| Report Abuse |
|
|
|
| 15 May 2014 03:34 PM |
script in workspace
local passid = 93044881 local tools = {"Illumina"} local GamePassService = Game:GetService('GamePassService') game.Players.PlayerAdded:connect(function(player) repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear if GamePassService:PlayerHasPass(player, passid) then Instance.new("Model",player).Name = "Has" end end)
localscript in textbutton
player = game.Players.LocalPlayer script.Parent.MouseButton1Click:connect(function() if game.Players.LocalPlayers:FindFirstChild("Has") then local passid = 93044881 local tools = {"Illumina"} repeat wait(0.1) until player.Backpack repeat wait(0.1) until player.StarterGear
for i = 1,#tools do game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.Backpack game.Lighting:FindFirstChild(tools[i]):Clone().Parent = player.StarterGear end end
end |
|
|
| Report Abuse |
|
|
|
| 15 May 2014 03:35 PM |
oop..
if player:FindFirstChild("Has") then
cuz I accidentily said "LocalPlayers" XD |
|
|
| Report Abuse |
|
|