|
| 03 Jan 2017 01:55 PM |
So this is a very simple script but for some reason it doesn't work in game it only works in studio? Any ideas? If more info needed i would be happy to reply.
function OnClick() script.Parent.Visible = false script.Parent.Parent.Save.Visible = true
end
script.Parent.Save.ImageButton.MouseButton1Click:connect(OnClick)
Thanks Trouble |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:03 PM |
Well here a bump....
And it is a localscript
If more info is needed i would be happy to reply.
Thanks Trouble |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jan 2017 02:33 PM |
Another Bump...
And btw there is no error in the output.
Thanks Trouble |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:47 PM |
| just post the location and the name of everything you want to change. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:50 PM |
| also your problem might be that Save may not be the parent of the script. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:52 PM |
Thanks for the help.
But i think that i found the problem:script in-game hasn't found the gui who should become visible so i just need to add a WaitForChild but thanks :).
I will test it tommorow and if it won't work i'll come back.
Thanks Trouble |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:52 PM |
| wait nvm I didnt read all of it |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:54 PM |
| you need to take a clean look on the line that connects the function |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:54 PM |
| you need to take a keen look on the line that connects the function |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 02:54 PM |
I have no idea why I posted clean
lmao |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:16 PM |
| Ok so this is weird. function OnClick() local truck = game.Workspace:FindFirstChild(player.Name.."truck") wait(0.2) truck:Destroy() wait(0.5) end script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick) this script is also in the same localscript but it has an error it says that Re isn't a valid member of the frame. But it is. here you can see the locations ################################################## If more info is needed i would be happy to reply. Thanks Trouble |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jan 2017 03:19 PM |
ok so it hashtagged the link
but here are the locations with words
-Tablet(Frame)(Parent for Main, Save and Re) -Main(Frame) LocalScript textbuttons -Save(Frame) -Re(Frame) |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:20 PM |
function OnClick() local truck = game.Workspace:FindFirstChild(player.Name.."truck") wait(0.2) truck:Destroy()
wait(0.5) end
script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick)
here's the script which has the error in the output saying Re is not a valid member of Frame. |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:20 PM |
| basically if u dont have "truck" you will be deleting the player which is another way of kicking the player from the game |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:21 PM |
nvm I need to pay more attention to these Im so off today |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 03:22 PM |
WaitForChild
Everything loads slower in game than solo test.
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:22 PM |
:D
YEA, but what about the the error of Re not being a valid member of frame but it is. |
|
|
| Report Abuse |
|
|
| |
|
|
| 03 Jan 2017 03:23 PM |
| Does waitforchild work in LocalScripts? |
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:23 PM |
| Obviously why would u ask that? |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 03:23 PM |
"script.Parent.Parent.Re.Truck.R.MouseButton1Click:connect(OnClick)" to script.Parent.Parent:WaitForChild("RE").Truck.R.MouseButton1Click:connect(OnClick)
|
|
|
| Report Abuse |
|
|
|
| 03 Jan 2017 03:24 PM |
A friend of mine once told me that WaitForChild in localscripts don't work(or maybe tho's were normal scripts.) So yea ok i'll test that.
Thanks! |
|
|
| Report Abuse |
|
|
OAuth2
|
  |
| Joined: 27 Nov 2016 |
| Total Posts: 751 |
|
|
| 03 Jan 2017 03:25 PM |
@Gomlsauresrex
Stop giving him wrong information. WaitForChild works for both scripts and localscripts, server or client.
|
|
|
| Report Abuse |
|
|