|
| 21 Oct 2015 12:18 AM |
I want to transfer 2 bits of info through a event yet I get this error on this line of code when it try to, Unable to cast value to Object, the object is mouse.Target
both in local scripts
playergui:WaitForChild("SurfaceGui"):WaitForChild("PlaceGui"):FireClient("E - Climb", object)
in other script
local gui = script.Parent local event = gui:WaitForChild("PlaceGui") local frame = gui:WaitForChild("Frame")
event.OnClientEvent:connect(function(text, object) print(text) print(object.Parent) gui.Adornee = object print("Done firing") end) |
|
|
| Report Abuse |
|
|
| |
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 21 Oct 2015 02:00 AM |
| Post the line of code where you set object to some value. |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 21 Oct 2015 02:02 AM |
| Also the first argument to FireClient should be the player. |
|
|
| Report Abuse |
|
|
|
| 21 Oct 2015 02:16 AM |
| @Ser, So it will always try to get player first? |
|
|
| Report Abuse |
|
|
Datamora
|
  |
| Joined: 06 Jun 2014 |
| Total Posts: 78 |
|
|
| 21 Oct 2015 05:03 AM |
| As Senanok sais you'll have to declare the player as the first argument in the FireClient method. Otherwise you'll simply bot know where you should send your request to. |
|
|
| Report Abuse |
|
|