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

How are does filtering enabled work with character control?

Asked by 6 years ago

So, Im working on making custom character controls, and ive been studying the default character control scripts and they are all local or module scripts(that run locally) and they set the humanoids movement. Does this mean that you can that you can change the character's humanoid and it will replicate to the server? Or should I use remote events for the control. I also set my game to filtering enabled and it appears the roblox defualt scripts dont use remote events, but they still replicated to the server. I was also not sure If it might be a built in roblox thing, like the core scripts. Could someone please explain.

2 answers

Log in to vote
1
Answered by 6 years ago
Edited by Goulstem 6 years ago

If you are asking about how to replicate the movements of the character, you can do it by giving the client NetworkOwnership over its character, this will be the smoothest way to move their character in the view of the client.

Ad
Log in to vote
0
Answered by
oSyM8V3N 429 Moderation Voter
6 years ago
Edited 6 years ago

If your game is Filtering Enabled, then you don't have to use remote events, unless your replicating the server, such as : Changing values, duplicating effects, and more on.

Speaking of character controls, you can use the UIS as shown here:

lcoal UIS = game:GetService("UserInputService")

UIS.InputBegan:Connect(function(Input, gameProcessedEvent)
local KeyCode = Input.KeyCode

if not gameProcessedEvent then -- Needed to check if the player isn't typing


if KeyCode == Enum.KeyCode."keyhere" then
--do your stuff here

end
end
end)

if your gonna change any values, your gonna have to use FireServer() with a RemoteEvent An example is shown here;

Server Script

local Event = "writewhereyoureventis"

Event.OnServerEvent:Connect(function(player)
--Do your stuff here
end)

Player Script

local Event = "writewhereyoureventis"

Event:FireServer() -- use this when you want to call the remoteevent to do your things

If you do want to send values using FireServer, then you can just add the value in the parenthesis like this:

Player Script

--Example:
local Event = "writewhereyoureventis"

local a = 0

Event:FireServer(a) -- Sends the a value

ServerScript

local Event = "writewhereyoureventis"

Event.OnServerEvent:Connect(function(player, a)
print(a) -- Prints the a value you send from the player script
end)

Since the function already calls the player, you don't need to add another player value.

If this did help, or you have any more questions, please feel free to comment!

--YBN_oSy

0
On every one of your code blocks there is an error F4ULT1NTH3D4T4 226 — 6y

Answer this question