Im trying to make it to where, It inserts Players name into the 'local owner' who touch the part 'Invisi' But it isnt working no Idea why...
Here is the script.
function onClicked (playerWhoClicked) local owner = { } for _,v in pairs(game.Workspace.floor:GetChildren()) do v["Claim Dorm"].Invisi.Touched:connect(function(hit) for _,l in pairs(game.Players:GetChildren())do if hit.Parent then local humanoid = l.Character:findFirstChild("Humanoid") if humanoid then script.Parent.Parent.Name = l.Name.."'s Dorm" table.insert(l.Name, #owner) end end end script.Parent.CanCollide = false script.Parent.Parent["Smooth Block Model"].CanCollide = false wait(5) script.Parent.CanCollide = true script.Parent.Parent["Smooth Block Model"].CanCollide = true end) end end script.Parent.ClickDetector.MouseClick:connect(onClicked)
The Touched event is inside the onClick function. So, the Touched event can only fire when ClickDetector is fired at the same time. Try making a different script that does what you need it to do, and insert it into all the doors. That's the only thing I can recommend right now, I can't test with Studio at this second.