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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: mouse.target remote-event ???????????????

Previous Thread :: Next Thread 
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
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
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
06 Apr 2015 06:56 PM
wiki
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
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
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
06 Apr 2015 07:09 PM
bump
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
06 Apr 2015 07:17 PM
bumpp
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
06 Apr 2015 07:23 PM
cmon guis help a spongebob in need
Report Abuse
affectless is not online. affectless
Joined: 28 Dec 2014
Total Posts: 1084
06 Apr 2015 07:24 PM
?????????????????????????????????????????????wAT?
Report Abuse
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
06 Apr 2015 07:24 PM
???????o.e what are you confused about
Report Abuse
rayk999 is not online. 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 is not online. 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
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
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
kingstarwest is not online. kingstarwest
Joined: 15 Aug 2010
Total Posts: 1156
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 is not online. 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
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