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: I'm getting some strange error, help!

Previous Thread :: Next Thread 
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
20 Sep 2017 02:50 PM
So I'm trying to make something complicated, a space station, when the airlock end hitbox is touched there is a FireClient remote fired, when the client receives it it's supposed to modify the gravity on the client, but i'm getting some weird error.

Here's the error:

Unable to cast value to Object
Stack Begin
Script 'my script location', Line 7
Stack End

Here's my hitbox script:

4 function onTouched(hit)
5 local name1 = hit.Parent
6 local player1 = game.Players:GetPlayerFromCharacter(name1)
7 local player = player1.Name
8 ClientGravityEvent:FireClient(player)
9 end

script.Parent.Touched:connect(onTouched)


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Minimarshmallo is not online. Minimarshmallo
Joined: 12 Apr 2016
Total Posts: 242
20 Sep 2017 02:57 PM
function onTouched(hit) local # # ########## local p = game.Players:GetPlayerFromCharacter(c.Name) if p then ClientGravityEvent:FireClient(p) end end I thought of it on the spot
Report Abuse
Minimarshmallo is not online. Minimarshmallo
Joined: 12 Apr 2016
Total Posts: 242
20 Sep 2017 02:58 PM
whoops

function onTouched(hit)
local Character = hit.Parent
local p = game.Players:GetPlayerFromCharacter(c.Name)
if p then
ClientGravityEvent:FireClient(p)
end
end
Report Abuse
Tacobell158 is not online. Tacobell158
Joined: 27 May 2016
Total Posts: 220
20 Sep 2017 03:00 PM
Really good
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
20 Sep 2017 03:01 PM
@Mini

c isn't defined


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Minimarshmallo is not online. Minimarshmallo
Joined: 12 Apr 2016
Total Posts: 242
20 Sep 2017 03:04 PM
Whoops again. c should be Character
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
20 Sep 2017 03:14 PM
Unable to cast value to Object
Stack Begin
Script 'my script', Line 6
Stack End

Line 6:

local p = game.Players:GetPlayerFromCharacter(Character.Name)



// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
20 Sep 2017 03:27 PM
'Elp


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 05:57 AM
Someone


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
21 Sep 2017 06:05 AM
maybe try an event function instead?

script.Parent.Touched:Connect(function(hit)
if hit and hit.Parent then
local name1 = hit.Parent
local player1 = game.Players:GetPlayerFromCharacter(name1)
local player = player1.Name
ClientGravityEvent:FireClient(player)
end

end)


#code error("you're*")
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 06:09 AM
Still doesn't work..

Basically the remote is fired in a server script that is located inside of a part.

Error i'm getting from your script.

Unable to cast value to Object
Stack Begin
Script 'Workspace.Hitbox.Script', Line 9
Stack End

Line 9: ClientGravityEvent:FireClient(player)


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 06:21 AM
Elp meeeeeeeee


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 06:33 AM
oh come onnn


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 06:50 AM
try ################
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 06:52 AM
########lients() with an i not ' (obviously
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 06:52 AM
Your message got filtered.


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 06:53 AM
the one that says all omg
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 06:55 AM
What do you mean?


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 07:02 AM
Is no one smart enough to just get a player's name when the part is touched what the heck people are u stoopid


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 07:03 AM
f(re@llclients()
Report Abuse
mightyWeSlEybAkEr is not online. mightyWeSlEybAkEr
Joined: 05 Jul 2011
Total Posts: 8
21 Sep 2017 07:04 AM
I don't think trash talking other scripters is gonna make us want to help you..
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 07:06 AM
Dude, are you blind or something?

I'm trying to only affect one client, and :FireClient() is the way to go, the problem is the god damn argument


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 07:08 AM
take the parameter out of FireClient
Report Abuse
Ashley_Phantom is not online. Ashley_Phantom
Joined: 18 Jan 2013
Total Posts: 2147
21 Sep 2017 07:10 AM
Mighty, if you can't handle being called "stoopid" in a joke way then you are truly god damn oversensitive. If you guys somehow can't figure out a way how to pass a player's name which is taken by an ontouched function through a remote event i'll just go over to scriptinghelpers.


// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB
Report Abuse
ISeeYourPost is not online. ISeeYourPost
Joined: 10 Jun 2013
Total Posts: 1815
21 Sep 2017 07:12 AM
read my reply and stop worrying about him and what he has to say
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