generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Unable to cast value to Object

Previous Thread :: Next Thread 
PotatoForce is not online. PotatoForce
Joined: 16 Oct 2015
Total Posts: 42
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
PotatoForce is not online. PotatoForce
Joined: 16 Oct 2015
Total Posts: 42
21 Oct 2015 01:39 AM
bump
Report Abuse
Seranok is not online. 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 is not online. 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
PotatoForce is not online. PotatoForce
Joined: 16 Oct 2015
Total Posts: 42
21 Oct 2015 02:16 AM
@Ser, So it will always try to get player first?
Report Abuse
Datamora is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image