|
| 06 Apr 2015 06:55 PM |
Localscript:
if unitlockedin == true and mouse.Target and mouse.Target.Parent.Name == "BerryBush" then game.ReplicatedStorage.pathfindbush:FireServer() end
Script: game.ReplicatedStorage.pathfindbush.OnServerEvent:connect(function(MouseTarget) if man then print(MouseTarget:GetFullName()) print(MouseTarget.Parent:GetFullName()) end end)
Why is it printing: Players.Player Players
???
MouseTarget should be equal to something in Workspace set inside the LocalScript |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Apr 2015 06:58 PM |
The Wiki doesn't help me with this and I just did:
if unitlockedin == true and mouse.Target and mouse.Target.Parent.Name == "BerryBush" then print(MouseTarget) print(MouseTarget:GetFullName()) game.ReplicatedStorage.pathfindbush:FireServer() end
and It was referencing the right thing inside workspace o.e |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 06 Apr 2015 07:23 PM |
| cmon guis help a spongebob in need |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 07:24 PM |
| ?????????????????????????????????????????????wAT? |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 07:24 PM |
| ???????o.e what are you confused about |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 06 Apr 2015 07:25 PM |
| Wait, you fired the server without any parameters but when the server is listening for the event it is also expecting a parameter to come with it |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 06 Apr 2015 07:26 PM |
err no, nvm
It returns the Player as the first para because onServerEvent also returns the player that fired |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 07:27 PM |
oki
I has stuff in localscript
if mouse.Target and mouse.Target.Parent.Name == "BerryBush" then print(MouseTarget) print(MouseTarget:GetFullName()) game.ReplicatedStorage.pathfindbush:FireServer(MouseTarget) end
it prints
Man Workspace.Man
and I has a script
game.ReplicatedStorage.pathfindbush.OnServerEvent:connect(function(MouseTarget) if man then print(MouseTarget) print(MouseTarget:GetFullName()) end end)
it prints
Player Players.Player
why is it printing Player?? It should print Man rite |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2015 07:28 PM |
O all I had to do is
game.ReplicatedStorage.pathfindbush.OnServerEvent:connect(function(player,MouseTarget)
qq thanks |
|
|
| Report Abuse |
|
|
vacha
|
  |
| Joined: 06 Jan 2011 |
| Total Posts: 1993 |
|
|
| 06 Apr 2015 07:31 PM |
try game.ReplicatedStorage.pathfindbush.OnServerEvent:connect(function(player,MouseTarget) print(MouseTarget) end)
because the first argument passed when a remote event fires is the player even when a local script doesn't specify it |
|
|
| Report Abuse |
|
|