|
| 02 Jul 2016 03:06 AM |
I need some help converting this, I'm unsure how. It's a script inside of a button of a GUI, that when you press it, these parts with these names become visible in a morph.
local player = script.Parent.Parent.Parent.Parent.Parent local torso = player.Character:FindFirstChild("Torso") function onClick(mouse)
player.Character.Chest.S5.Transparency = 0 player.Character.Chest.S6.Transparency = 0 player.Character.Chest.S7.Transparency = 0 player.Character.Chest.S8.Transparency = 0 player.Character.Chest.S9.Transparency = 0 player.Character.Chest.S10.Transparency = 0 player.Character.Chest.S11.Transparency = 0
end
script.Parent.MouseButton1Down:connect(onClick)
Unfortunately whenever FilteringEnabled is checked, these kind of scripts break.. |
|
|
| Report Abuse |
|
|
0Dan
|
  |
| Joined: 22 Oct 2009 |
| Total Posts: 2552 |
|
|
| 02 Jul 2016 03:15 AM |
Tell me if this works
--RemoteEvent in Workspace script.Parent.OnServerEvent:connect(function(player) print(player.Name) if(player.Character:FindFirstChild("Torso")~=nil)then player.Character.Chest.S5.Transparency = 0 player.Character.Chest.S6.Transparency = 0 player.Character.Chest.S7.Transparency = 0 player.Character.Chest.S8.Transparency = 0 player.Character.Chest.S9.Transparency = 0 player.Character.Chest.S10.Transparency = 0 player.Character.Chest.S11.Transparency = 0 end end)
--LocalScript inside TextButton script.Parent.MouseButton1Down:connect(function() game.Workspace.RemoteEvent:FireServer() end)
local l={e={a={v={e=function()print("bye")end}}}} l.e.a.v.e() |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 03:22 AM |
| Ah it works! Thank you SO much for the help, I appreciate it! |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 03:24 AM |
| Oh wAIT- It works in Play mode but when I save it, and play it as a normal game it doesn't work. That's odd? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 04:06 PM |
| Does anyone know why this is happening? |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 04:31 PM |
Use WaitForChild() or Wait() for a couple of seconds. Studio does that to me too.
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 05:07 PM |
Hmm. Whenever I add that, the scripts break in test mode now. Like this?
--(Script that's in the button) repeat wait() until Player.Character Character = Player.Character Character:WaitForChild() script.Parent.MouseButton1Down:connect(function() game.Workspace.RemoteEvent:FireServer() end)
--(Script that's in the RemoteEvent) repeat wait() until Player.Character Character = Player.Character Character:WaitForChild() script.Parent.OnServerEvent:connect(function(player) print(player.Name) if(player.Character:FindFirstChild("Torso")~=nil)then player.Character.Chest.Hologram.Transparency = 0 end end)
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 05:11 PM |
No, no. I meant something like wait a certain amount of seconds. Even if it's just one, you have to give your game time to load all the assets. Use something like wait(1) or game.Workspace:WaitForChild("Blah")
|
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 05:54 PM |
Oh. Okay, so does that go into the same script as those up there ^^^
Or is it its own thing? I'm sorry, I'm not too experienced. |
|
|
| Report Abuse |
|
|
|
| 02 Jul 2016 05:57 PM |
It's no problem, you ask what you need to, that's what a forum is here for. Yes, it would go before the majority of your functions.
|
|
|
| Report Abuse |
|
|
SloeGin
|
  |
| Joined: 22 Jan 2011 |
| Total Posts: 322 |
|
|
| 02 Jul 2016 06:04 PM |
You'll learn to love WaitForChild() in a way. It does have my children.
218,230 slices of pizza and counting |
|
|
| Report Abuse |
|
|