Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Any possible way to define mouse properly in FE?

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?

2 comments

1

You can't. Even with using RemoteFunctions, all you'll get is nil.

0

What are you trying to do? We need more information.

2 answers

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

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.