Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Use indentation to silence error?

I'm making a selling script for a player on the (Dirt brown) team and if they click on the player while on that team it will print the player's user. (for debugging at the moment) So far I have got:

local Player = game.Players.LocalPlayer -- Getting the player   
local Mouse = Player:GetMouse() -- Getting the players mouse

Mouse.Button1Down:Connect(function() -- Detecting when player presses the left mouse button

    if Mouse.Target.Parent:FindFirstChild("Humanoid") and 
		game.Players.LocalPlayer.Team == "Dirt brown" then -- Checking if the Mouse is over a player
        print(Mouse.Target.Parent.Name) 
    end

end)

What is indentation and how can I apply it?

2 comments

0

I have a error on line 7 about use indentation to silence

0

where it says to indent, just press tab

1 answer

✓ Accepted answer

Hmm, I didn't get that error, but I indented it for you. Try this:

local Player = game.Players.LocalPlayer -- Getting the player   
local Mouse = Player:GetMouse() -- Getting the players mouse


Mouse.Button1Down:Connect(function() -- Detecting when player presses the left mouse button
	if Mouse.Target.Parent:FindFirstChild("Humanoid") and 
		game.Players.LocalPlayer.Team == "Dirt brown" then -- Checking if the Mouse is over a player
		print(Mouse.Target.Parent.Name) 
	end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.