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

Alternative to Humanoid:MoveTo() for a local script?

Recently, I've been developing an engine for turn-based battle mechanics, very similar to Paper Mario. The extremely early and primitive engine can be found here if you would like to review it. The first tactic I've been trying to script is a jumping mechanic where your character jumps on the enemy, again, similar to Paper Mario. However, the physical battle is only on the client-side, while only being emulated by the server. The only problem with this model is that Humanoid:MoveTo() only works on the server-side(?), and I can't move either of the two characters on the server-side without it replicating on all clients. Is there a solution to this problem? I have no idea how to move each character any other effective way.

1 answer

✓ Accepted answer

You can listen to input from the client and send it through a RE. The server then will use :MoveTo() itself.

You can also very easily listen to that input by using Roblox's built-in control modules:

local Player = game.Players.LocalPlayer
local ControlModule = require(Player:WaitForChild "PlayerScripts" :WaitForChild "PlayerModule" :WaitForChild "ControlModule" )
local MoveVector = ControlModule:GetMoveVector()

2 comments

0

Thanks! I'll try adding this in tomorrow.

0

Glad I was able to help :D

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