I’m working on a feature for my Backrooms game that allows me to easily film trailers and made this script to allow me and only me to open the UI to use it, but for some reason the addition of this script causes the game to immediately crash.
input = script.Parent
plrID = game.Players.LocalPlayer.UserId
enabled = false
inputService = game:GetService("UserInputService")
if plrID == 656329197 then
enabled = true
else
script:Destroy()
end
while enabled do
inputService.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.T then
input.Visible = true
end
end)
end
input = script.Parent
plrID = game.Players.LocalPlayer.UserId
inputService = game:GetService("UserInputService")
if plrID == 656329197 then
inputService.InputBegan:Connect(function(inputObject)
if inputObject.KeyCode == Enum.KeyCode.T then
input.Visible = true
end
end)
else
script:Destroy()
end