- What do you want to achieve? Keep it simple and clear!
a console that when you press enter it sends the text to the server and removes the text
- What is the issue? Include screenshots / videos if possible!
The stuff inside the if statement doesnt ever run
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
didnt find anything like this specifically
this is what i currently have, yes its a local script and is in the textbox.
local isFocused = false
script.Parent.Focused:Connect(function()
isFocused = true;
end)
script.Parent.FocusLost:Connect(function()
isFocused = false;
end)
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.Return and isFocused then
game:GetService("ReplicatedStorage"):WaitForChild("Remotes"):WaitForChild("PrivateServer"):WaitForChild("submitCommand"):FireServer(script.Parent.Text)
script.Parent.Text = ""
end
end)