So, I have a script that shoots a bullet when a tool is selected and the mouse is clicked. The script itself works fine. But right after a player joins and uses it, just like 1 second after he/she joins, the localscript just breaks. Is there a statement that can prevent this from happening?
You need to be more specific when asking your questions. If your third comment to your Question had been your Question, we wouldn't have had a problem.
Anyway;
local player = game.Players.LocalPlayer local character = player.Character if not character then --If you manually LoadCharacter, this script will sometimes run the first time before a Character exists at all. player.CharacterAdded:wait() character = player.Character end while not character.Parent do wait() end