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 
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 07:22 AM
:InvokeServer(Message, "Bright green", "Bright blue")
String, BrickColor, BrickColor

.OnServerInvoke(Player, Message, PlayerColor, MessageColor)

It works in studio and server simulation mode, but not in game, what's the problem? The rest of my code works fine..


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 08:14 AM
Bump


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
06 Aug 2016 08:29 AM
You didn't post any code, how exactly is someone suppose to help you?
Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 08:52 AM
What code do you need?..


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
Toonshield is online. Toonshield
Joined: 04 Mar 2015
Total Posts: 518
06 Aug 2016 08:54 AM
Also dividing by zero doesn't error. It just gives you inf.
Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 08:55 AM
.. its a joke..


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
06 Aug 2016 09:07 AM
Those are strings, not BrickColors. You need to use BrickColor.new to make them BrickColors.


Report Abuse
0Dan is not online. 0Dan
Joined: 22 Oct 2009
Total Posts: 2552
06 Aug 2016 09:09 AM
Post the code of your RemoteFunction, we most likely can't help you without it.


Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 09:31 AM
For the sake of what it does, I call them brick colors, I know they're strings.
Here's the server side, but this isn't the problem.
function script.SendMessage.OnServerInvoke(Player, Message, PlayerColor, MessageColor)
local Filtered = Message
if checkSpam(Message) then
if not game:GetService("RunService"):IsStudio() then
Filtered = Chat:FilterStringAsync(Message, Player.Name, Player.Name)
end
table.insert(MsgHistory, 1, Message)
GenMessage(Message, Player, MessageColor, PlayerColor)
else
warn("Spam detected")
end
end

As for the localscript side, it's a bit complicated, but it just gets the input from a textbox (aka what ever the user types)

game.Workspace.ChatHandler.SendMessage:InvokeServer(Message, PlayerColor, MessageColor)


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
06 Aug 2016 09:34 AM
"Message, Player.Name"


Is that supposed to be Player.Name, or is it looking for Player?


Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 09:39 AM
Oh, sorry, ignore that.. I was messing around with things. It does pass the player to the server, right? Or is that my problem?


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
06 Aug 2016 09:46 AM
It does. What line is this on again?


Report Abuse
LetterSlayer is online. LetterSlayer
Joined: 02 Aug 2010
Total Posts: 946
06 Aug 2016 09:48 AM
The error? It's in the local script, where it gets passed to the server,

if Message then
game.Workspace.ChatHandler.SendMessage:InvokeServer(Message, PlayerColor, MessageColor)--message, player color, chat color -----<<<<<<<<<
startTimeout(Timeout)
Input.Text = "Press '/' to chat, or click me!"
end


ERROR YOU DIVIDED BY ZERO. ZERO. 0. THIS IS BAD. The world is now ending because of you!
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