This is the line of code that doesnt work:
if e[i].creator.Value == player then print("Works") end
I'm not recieving an error so I'm really not sure what's going wrong, I've tried changing 'player' to 'player.Name' but that didn't work either.
Here is the rest of the code for context:
player = game.Players.LocalPlayer PathTool = script.Parent mouse = player:GetMouse() function Clean() print(player) e = game.Workspace:GetChildren() for i = 1, #e do if e[i].className == "Part" then if e[i].Name == "PathPlatform" then if e[i]:findFirstChild("creator") ~= nil then if e[i].creator.Value == player then print("Works") end end end end end end mouse.KeyDown:connect(function(key) if key:byte() == 114 then Clean() end end)
Any help would be greatly appreciated, I've tested the script and every line works except for 'if e[i].creator.Value == player then' - no error message in my Output either!
(Also I should add that the value of the Part.creator.Value is equal to the player's name)