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

Creating a mining game with FE?

Asked by
dirk2999 103
6 years ago

So i just need some clarification. How do you get the mouse with FE? When the player has the tool equipped I want a selection box around the block that their mouse is over, is that client or server sided? Creating blocks I would have to do a remote event right?

0
Can’t get the mouse from the server. You can get the target, and hit from it though as parameters. User#19524 175 — 6y
0
seeing that a selection box would be wanted to see only by the player that it's useful for, i'd use a localscript. RubenKan 3615 — 6y

1 answer

Log in to vote
1
Answered by
chomboghai 2044 Moderation Voter Community Moderator
6 years ago

FilteringEnabled essentially forces server wide changes made by a client to be run through the server rather than directly to other clients.

This means if inside a LocalScript, you create a new block instance, that block instance will only be seen by the client who ran it.

If you'd like to get the mouse with FE, you'd just use a LocalScript and do:

local localPlayer = game.Players.LocalPlayer
local localMouse = localPlayer:GetMouse()

Selection boxes are generally only client side, unless you want everyone to see everyone else's selection boxes. This means you should create a new selection box instance inside of a LocalScript.

Creating blocks that other users can see would have to be done through a server - this can mean using a remote event and listening for that event to fire on the server, which then creates the block on the server sided script.

Hope this helps.

Ad

Answer this question