Ignore the indenting I wrote this outside of studio but tell me if this is a bad way to code?
repeat wait() until game.Players.LocalPlayer.Character
Player = game.Players.LocalPlayer
c = Player.Character
game:GetService("UserInputService").InputBegan:Connect(function(input,isTyping)
if isTyping then return end
if input.KeyCode == Enum.KeyCode.E then
end
end)
You could remove the repeat wait() until game.Players.LocalPlayer.Character and change c = Player.Character or Player.CharacterAdded:Wait() Hope this makes the script look better.
In any while true do, while wait do, always add a wait or it will LAG A LOT. So, when making a loop, add a wait(), it can be empty, but it will still wait a tenth of a second, avoiding lag.