Hello, I am making a surrendering/capturing script. I am setting up so when you capture someone you can say “/cp [player] follow” to have them follow you, but i need to disable the character controller.
I have no clue how to do this, if you know then please tell me.
Server Side Script :
local Teams = game:GetService("Teams")
local Captured = {}
local Surrenderd = {}
local Surrender = game.ReplicatedStorage.Surrender
local Capturing = game.ReplicatedStorage.Capture
local Stage1 = game.ReplicatedStorage.CapturedLABEL
local stage1 = game.ReplicatedStorage.SurrenderedLABEL
local turnonoff = game.ReplicatedStorage.turnon
Surrender.OnServerEvent:Connect(function(player)
for p,s in pairs(Captured) do
if p == player then
else
Surrenderd[player] = true
local Head = player.Character:FindFirstChild("Head")
local Cloned1 = stage1:Clone()
local Cloned2 = Stage1:Clone()
Cloned1.Parent = Head
Cloned2.Parent = Head
end
end
if Captured.Length == nil then
Surrenderd[player] = true
local Head = player.Character:FindFirstChild("Head")
local Cloned1 = stage1:Clone()
local Cloned2 = Stage1:Clone()
Cloned1.Parent = Head
Cloned2.Parent = Head
end
end)
Capturing.OnServerEvent:Connect(function(player, CapturedPlayer)
for s,d in pairs(Surrenderd) do
if s == CapturedPlayer then
Surrenderd[CapturedPlayer] = nil
Captured[CapturedPlayer] = player
local Head = CapturedPlayer.Character:FindFirstChild("Head")
local STAGE1 = Head.CapturedLABEL
local STAGE2 = Head.SurrenderedLABEL
if STAGE1 and STAGE2 then
STAGE1:Destroy()
STAGE2:Destroy()
end
end
end
end)
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
for CapturedPlayer, PlayerThatCaptured in pairs(Captured) do
if player == CapturedPlayer then
--do nothing
elseif player == PlayerThatCaptured then
if msg:match("/cp") then
local words = string.split(msg, " ")
local cp = words[2]
local cmmd = words[3]
if cmmd == "follow" or cmmd == "Follow" and cp == game.Players:GetFistChild(CapturedPlayer) then
--CapturedPlayer.Character.Humanoid
turnonoff:FireClient(CapturedPlayer, "off")
end
if cmmd == "endfollow" or cmmd == "Endfollow" and cp == game.Players:GetFistChild(CapturedPlayer) then
turnonoff:FireClient(CapturedPlayer, "on")
end
end
end
end
end)
end)
Client Side :
-- i need help with the client side