I have been attempting to create a input system what does not trigger when chatting.
The issue I am currently having is the chat duplicates itself when I try and require the chat module
local Runservice = game:GetService(“RunService”)
local UserInput = game:GetService(“UserInputService”)
local Character = game.Players.LocalPlayer.Character
local Humanoid = Character:WaitForChild(“Humanoid”)
local IsChatting = false
local Dead = false
local Ragdolled = false
UserInput.InputBegan:Connect(function(Input) – Ragdoll stuff goes here
if Input.KeyCode == Enum.KeyCode.F and Ragdolled == false and Dead == false and IsChatting == false then
Ragdolled = true
print(“i am ragdol”)
elseif Input.KeyCode == Enum.KeyCode.F and Ragdolled == true and Dead == false and IsChatting == false then
Ragdolled = false
print(“i am less ragdol”)
end
end)
Humanoid.Died:Connect(function()
if Dead == false and Ragdolled == false then
Dead = true
elseif Dead == false and Ragdolled == true then
Dead = true
end
end)
Runservice.RenderStepped:Connect(function()
local ChatModule = require(game.Chat:WaitForChild(“ChatScript”):WaitForChild(“ChatMain”)) – whenever i try and require the chat it just duplicates it
IsChatting = ChatModule:IsFocused()
end)
How do I prevent this