Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Script won't run even though all of the conditions are true?

Asked by 4 years ago

script.Parent.Head.Touched:Connect(function(hit) local plr = game.Players:GetPlayerFromCharacter(hit.Parent) if plr ~= nil then if script.Parent.Parent.Owner.Value == nil then if hit.Parent:FindFirstChild("Humanoid") then local owntycoon = plr:FindFirstChild("OwnsTycoon") if owntycoon.Value == nil then script.Parent.Name = plr.Name.. "'s Tycoon" script.Parent.Parent.Owner.Value = plr.Name end end end end end)

Any clue? OwnsTycoon exists too. I don't get what's wrong?

1
The conditions are not true, script.Parent.Parent.Owner.Value may be an empty string "" which is not equal to nil. even then, the value will never be nil, always a string. What owntycoon is is beyond me User#24403 69 — 4y
0
Thanks :) headlessbamba 0 — 4y

Answer this question