|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 20 Sep 2017 03:01 PM |
@Mini
c isn't defined
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2017 03:04 PM |
| Whoops again. c should be Character |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 20 Sep 2017 03:27 PM |
'Elp
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2017 05:57 AM |
Someone
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 21 Sep 2017 06:21 AM |
Elp meeeeeeeee
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2017 06:33 AM |
oh come onnn
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Sep 2017 06:52 AM |
| ########lients() with an i not ' (obviously |
|
|
| Report Abuse |
|
|
|
| 21 Sep 2017 06:52 AM |
Your message got filtered.
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Sep 2017 06:55 AM |
What do you mean?
// ASUS GTX 1070 STRIX / i7 6700k / TridentZ RGB 16GB |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 21 Sep 2017 07:04 AM |
| I don't think trash talking other scripters is gonna make us want to help you.. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 21 Sep 2017 07:08 AM |
| take the parameter out of FireClient |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 21 Sep 2017 07:12 AM |
| read my reply and stop worrying about him and what he has to say |
|
|
| Report Abuse |
|
|