My script does not seem to go to my else section at all. Here's the script
sp = script.Parent
Debounce = false
sp.Touched:connect(function(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local Human = hit.Parent:FindFirstChild("Humanoid")
if Human ~= nil then
print("Human is true")
if player.Backpack:FindFirstChild("Sword") == nil then
if Debounce == false then Debounce = true
print("Player does not have tool!")
local Tool = game.ReplicatedStorage:FindFirstChild("Sword")
Tool = Tool:Clone()
Tool.Parent = player.Backpack
Debounce = false
else --Problem here
if Debounce == false then Debounce = true
print("Player does have tool!")
local msg = Instance.new("Message", player.PlayerGui)
msg.Text = "You cannot get this tool twice!"
wait(2)
Debounce = false
msg:remove()
end
end
end
end
end)
At line 17, I do not even see in the output it saying "Player does have tool!" Did I mess up and end or something? I have tried making line 17 become
elseif player.Backpack:FindFirstChild("Sword") ~= nil then

2 comments
Thank you, I fixed my Debug as well. (This works)
Cleaned up a little more: http://hastebin.com/rocuxexola.lua