|
| 13 Sep 2015 04:59 PM |
| So I was scripting a remote function (Making the baseplate change color using a ClickDetector Button). It worked fine in studio, but when I went into the game outside of studio, it refused to work. Any solutions to this? |
|
|
| Report Abuse |
|
|
TwoRivers
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 2821 |
|
|
| 13 Sep 2015 05:00 PM |
SOLUTION: GET BETTER CODE
-TwoRivers/Iterum/Vulnerite/ChiefDelta/Discommodate/100+ accounts |
|
|
| Report Abuse |
|
|
| |
|
TwoRivers
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 2821 |
|
|
| 13 Sep 2015 05:01 PM |
NEITHER DOES THIS THREAD YOU DIDNT POST CODE
-TwoRivers/Iterum/Vulnerite/ChiefDelta/Discommodate/100+ accounts |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:03 PM |
Heres the first script
local event = Instance.new("RemoteEvent") event.Parent = game.Workspace event.Name = "MyServerEvent" event.OnServerEvent:connect(function() game.Workspace.Baseplate.BrickColor = BrickColor.Random() end)
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:04 PM |
Heres the second script
game.Workspace.Brick1.ClickDetector.MouseClick:connect(function(hit) game.Workspace.MyServerEvent:FireServer() end)
|
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:04 PM |
| Why are you placing the remote event in workspace? |
|
|
| Report Abuse |
|
|
TwoRivers
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 2821 |
|
|
| 13 Sep 2015 05:05 PM |
event.OnServerEvent:connect(function(player)
-TwoRivers/Iterum/Vulnerite/ChiefDelta/Discommodate/100+ accounts |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:05 PM |
| do remoteevent.Parent = workspace.Baseplate |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:06 PM |
| oh never my bad lmao I thought it was clickdetector xD |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:08 PM |
| It is still not working in game. It works in studio still. |
|
|
| Report Abuse |
|
|
TwoRivers
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 2821 |
|
|
| 13 Sep 2015 05:09 PM |
you didnt wait for the event 2 exist
-TwoRivers/Iterum/Vulnerite/ChiefDelta/Discommodate/100+ accounts |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:10 PM |
| Don't you have to wait 5 seconds? |
|
|
| Report Abuse |
|
|
TwoRivers
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 2821 |
|
|
| 13 Sep 2015 05:13 PM |
why 5 seconds
-TwoRivers/Iterum/Vulnerite/ChiefDelta/Discommodate/100+ accounts |
|
|
| Report Abuse |
|
|
|
| 13 Sep 2015 05:15 PM |
| I waited like a minute and it still did not work. |
|
|
| Report Abuse |
|
|
gombob
|
  |
| Joined: 01 May 2008 |
| Total Posts: 5215 |
|
|
| 13 Sep 2015 05:18 PM |
remote functions are used to communicate between scripts and localscripts but I think you are using 2 (normal) scripts.
that means you have to use a bindable function/event (instead of a remote function), because they allow communication between 2 (normal) scripts. |
|
|
| Report Abuse |
|
|
gombob
|
  |
| Joined: 01 May 2008 |
| Total Posts: 5215 |
|
|
| 13 Sep 2015 05:20 PM |
| it works in studio because studio treats localscripts and (normal) scripts the same (weird huh?) |
|
|
| Report Abuse |
|
|