Hover over it with your mouse, see why
Don’t copy code from me, I am on mobile so my quotation marks are unknown to Roblox studio, type it on your own.
That explains the print not working lol, that honestly really confused me
Yes, see if it prints in play test
Perfect now add print statements after if statements, and other lines of code.
(after doing what @Waffle_Gamer6 said)
wait, what is the point in added the print? The code is working it just is doing it multiple times
I have a question. Did you put this script in multiple parts?
if you did, that is why this is happening
— action
print(“Line 1 works!”)
— action that does not work or yields
print(“Line 2 works!”)
You will get output saying “Line 1 works!” only letting you know that line 2 is where the isssue is.
I would recommend using tags and collection service. @EliottENAnnoucement if you are I can help you set up tags.
script.Parent.Touched:Connect(function(part) -- check if the part has been touched, then run the function. The part is the part that touched this part
print("Event successfully called.")
local cooldown = false
print("Cooldown variable successfully false. [1]")
if part.Parent:FindFirstChild("Humanoid") then -- check if the part has a sibling called "Humanoid" humanoid is only in characters
print("Humanoid successfully checked.")
if cooldown == false then
print("Cooldown successfully false. [2]")
local tool = game.Workspace.GloveNameHere:Clone() --change "Workspace" to wherever your tool is and continue going down the children if it is in another thing, and change "Tool" to the name of your tool. This is cloning the tool
print("Tool variable successfully GloveNameHere.")
tool.Parent = part.Parent -- put the tool in the players character, this makes it start equiped.
print("Tool is now successfully in players characters.")
cooldown = true
print("Cooldown successfully true.")
wait(1)
print("Conter successfully ended.")
cooldown = false
print("Cooldown successfully false [3].")
end
print("Successfully ended. [1]")
end
print("Successfully ended. [2]")
end)
print("Successfully ended. [3]")
lol I added a print to all line. Did I make an error?
Lets check if the player already has the tool, so it does not give another one.
script.Parent.Touched:Connect(function(part) -- check if the part has been touched, then run the function. The part is the part that touched this part
cooldown = false
if part.Parent:FindFirstChild("Humanoid") and not part.Parent:FindFirstChild("GloveNameHere") then -- check if the part has a sibling called "Humanoid" humanoid is only in characters. We are also checking if the player already has the glove.
if cooldown == false then
local tool = game.Workspace.GloveNameHere:Clone() --change "Workspace" to wherever your tool is and continue going down the children if it is in another thing, and change "Tool" to the name of your tool. This is cloning the tool
tool.Parent = part.Parent -- put the tool in the players character, this makes it start equiped.
cooldown = true
wait(1)
cooldown = false
end
end
end)
So I added all the prints for no reason??
The prints are still good to have, but I got this code form higher up, where I could copy it. In the screenshot can not copy and edit.
Yes! I am glad it worked!
after 76 replies lol
lol. I will make the “you met a waffle” badge in my game just now! Do you want a certain icon for the badge?
I would keep the prints for future use and to find bugs in the future, sorry for recommending the wrong thing.
I don’t mind what you make it, but some ideas are:
- My profile pic
- A cartoony waffle
- My Waffle Productions Group icon (Maybe not, I just added this so there is more choice.)
I am sure it is fine, at least you tried to help. also, @EliottENAnnoucement, this is a good idea, print checkpoints are really good. But if you think it starts to just fill the output too much, you can remove them.