Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any possible way to define mouse properly in FE?

Asked by 7 years ago

So, I'm trying, trying. But I can't figure it out. I read that mouse objects aren't possible in Server Scripts. Is there any possible way?

I got this. In the local script.

plr = game.Players.LocalPlayer
game.Workspace.FE.Saber:FireServer(plr:GetMouse(),plr)

And this in the server script.

Link to the script. It was too big.

I get all errors about the mouse object.

Any help?

1
You can't. Even with using RemoteFunctions, all you'll get is nil. OldPalHappy 1477 — 7y
0
What are you trying to do? We need more information. Async_io 908 — 7y

2 answers

Log in to vote
1
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited by OldPalHappy 7 years ago

There is no way possible, which allows you to send the mouse object, as the server doesn't have a mouse.

You'll have to send over all properties of the mouse that you want to send to the server every time you need them.

Event:FireServer(mouse.Target,mouse.Hit) -- etc
Ad
Log in to vote
0
Answered by
Async_io 908 Moderation Voter
7 years ago

I attempted to understand what you're trying to do. I assume you're making a lightsaber, and upon clicking you're making it slash, correct?

INFO

  • If so, then I have a solution for you. If not, then you can probably salvage some ideas from this. Using a remote event can be extremely handy, as you can perform tasks dependent on local script events, from a server script. I.e, performing a mouse-based event in a local script, and telling the server script it happened via a remote event.

TL;DR

  • Use the wiki to review RemoteEvents. Sending an event in a local script to a server script can allow you to perform tasks dependent on local events, in server scripts.

IDEA

  • Use a remote event to tell a server script when you're clicking. When the event is fired and contains your arguments, such as the mouse and what action the mouse is performing, it will perform the string of code in the server script.

Answer this question