|
| 06 Jul 2015 07:49 PM |
local plr = game.Players.LocalPlayer
while true do wait() if script.Parent.Parent.AwayGK.Value == true then game.ServerStorage.Goalie:Clone().Parent = plr.Backpack plr.Backpack.Stick:remove() end end |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 07:50 PM |
First off, dont use :remove(), use :Destroy()
Secondly, whats wrong? Any output? |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jul 2015 07:53 PM |
local plr = game.Players.LocalPlayer
while true do wait() if script.Parent.Parent.AwayGK.Value == true then print("true") game.ServerStorage.Goalie:Clone().Parent = plr.Backpack plr.Backpack.Stick:Destroy() else print("false") end end
tell me what it prints |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Jul 2015 08:05 PM |
follow up.
Works good in studio
Doesn't work in real game |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:14 PM |
| correct correction it only works in play solo mode |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Jul 2015 08:14 PM |
check your errors and debug your script
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:17 PM |
| it doesn't produce a output tho... |
|
|
| Report Abuse |
|
|
mycheeze
|
  |
| Joined: 27 Jun 2011 |
| Total Posts: 6748 |
|
|
| 06 Jul 2015 08:18 PM |
>Make sure this is a local script
local P = game.Players.LocalPlayer
while wait() do local V = script.Parent.Parent:FindFirstChild'AwayGK' if V.Value then print'true' game.ServerStorage.Goalie:Clone().Parent = P.Backpack local S = P.Backpack:FindFirstChild'Stick' if S then S: Destroy() end else print'false' end end |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:23 PM |
@mycheez
no outputs doesn't even print anything or work. But it does work in play solo. And yes all these scripts have been local
local P = game.Players.LocalPlayer
while wait() do local V = script.Parent.Parent:FindFirstChild'AwayGK' if V.Value then print'true' game.ServerStorage.Goalie:Clone().Parent = P.Backpack local S = P.Backpack:FindFirstChild'Stick' if S then S:Destroy() end else print'false' end end |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Jul 2015 08:23 PM |
local script
local player = game.Players.LocalPlayer local awayGK = script.Parent.Parent.AwayGK
awayGK.Changed:connect(function() if awayGK.Value then game.ServerStorage.Goalie:Clone().Parent = player.Backpack player.Backpack.Stick:Destroy() end end)
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:23 PM |
| Incase it matters its local script inside startergui inside AwayGK Value |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:25 PM |
@time
didn't work only worked in play solo :/ |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 06 Jul 2015 08:26 PM |
script.Parent.Parent:FindFirstChild'AwayGK' P.Backpack:FindFirstChild'Stick'
FindFirstChild is used like :FindFirstChild("itemhere") not :FindFirstChild'AwayGK'
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 06 Jul 2015 08:29 PM |
If it's not working in online mode you need to show the output. Is there a nil value? You most likely have to do
WaitForChild("AwayGK") for example
"Talk is cheap. Show me the code." - Linus Torvalds |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:31 PM |
"FindFirstChild is used like :FindFirstChild("itemhere") not :FindFirstChild'AwayGK'"
Incorrect.
:FindFirstChild'name'
^ That works correctly, much the same as
print'string' |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 06 Jul 2015 08:32 PM |
@the I know it works, it's just odd seeing that, but oh well.
Do you have FilteringEnabled on? If you do, you can't use this in a localscript. |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:34 PM |
Theres no output. I'm guessing your not allow to change peoples backpacks from startergui. Or something like that. I ended up improvising and pretty much duplicating the value from startergui once it becomes true to workspace. Then getting players name. Going through a normal script in workspace. And doing what I wanted. It sounds very inefficient because it probably was but it works so I'm good.
Thanks for help guys! |
|
|
| Report Abuse |
|
|
Krosskode
|
  |
| Joined: 26 Aug 2010 |
| Total Posts: 11001 |
|
|
| 06 Jul 2015 08:35 PM |
| But, are you using FilteringEnabled or not? |
|
|
| Report Abuse |
|
|
|
| 06 Jul 2015 08:40 PM |
Scripting: 8.5/10
ya no [2] |
|
|
| Report Abuse |
|
|