--Local Script
USER_INPUT_SERVICE.InputBegan:Connect(function(input, GPE)
if GPE then return end
if input.KeyCode == Enum.KeyCode.E then
if TOOLENABLED == true then
if game.Workspace.FX.ROOM:FindFirstChild("Room_Part") then
if ROOMCOMPLETED == true then
if SHAMBLESENABLED == true then
SHAMBLESENABLED = false
local mouseTarget = mouse.Target
ShamblesActivationEvent:FireServer(mouseTarget)
wait(SHAMBLESCOOLDOWN)
SHAMBLESENABLED = true
end
end
end
end
end
end)
ShamblesActivationEvent.OnServerEvent:Connect(function(Player, mouseTarget)
local zoneGroup = game.Workspace.FX.ROOM
local zone = Zone.new(zoneGroup)
local isTargetWithinZoneBool = zone:findPart(mouseTarget)
local isPlayerWithinZoneBool = zone:findPlayer(Player)
if isTargetWithinZoneBool and isPlayerWithinZoneBool then
if not mouseTarget.Parent:IsA("Accessory") then
mouseTarget.Parent.HumanoidRootPart.Anchored = true
mouseTarget.Parent.Humanoid.WalkSpeed = 0
wait(.001)
local EnemyLocation = mouseTarget.Parent.HumanoidRootPart.CFrame
local PlayerLocation = Player.Character.HumanoidRootPart.CFrame
Player.Character.HumanoidRootPart.CFrame = EnemyLocation
mouseTarget.Parent.HumanoidRootPart.CFrame = PlayerLocation
mouseTarget.Parent.HumanoidRootPart.Anchored = false
mouseTarget.Parent.Humanoid.WalkSpeed = 16
print("Shambles")
end
end
end)
-- Server Side Script
ShamblesActivationEvent.OnServerEvent:Connect(function(Player, mouseTarget)
Shambles:FireAllClients(Player, mouseTarget)
end)
Can anyone tell me why this has a weird delay on switching the locations of the player and the mouseTarget, and why sometimes it only moves one of them. EDIT: I’m pretty sure this is happening because I’m doing this on a local script, does anyone know of a way I could implement this into a server script with a remote event