local Part = game.Workspace.MediterraneanAvenue local function playerHasTool(player, toolName) local tool = player.Backpack:FindFirstChild(toolName) or player.Character:FindFirstChild(toolName) if tool then return true else return false end end local Player Part.Touched:Connect(function(HIT) Player = game.Players:GetPlayerFromCharacter(HIT.Parent) local H = HIT.Parent:FindFirstChild("Humanoid") if H and not game.ReplicatedStorage:FindFirstChild("MediterraneanAvenue") and not playerHasTool(Player,"MediterraneanAvenue") then print("Conditional recognized.") script.Parent.Visible = true end end)
This is my script. So I want a GUI to appear if a tool isn't found with a player or in replicated storage. Why isn't the gui appearing? Is there an error with my conditionals? Please help me!
So I checked your code and saw some POSSIBLE error, Forgetting to call your function (This may be wrong but try calling as shown down below), also if you want the GUI to appear only when the brick is touched then put the function called inside the > Part.Touched Event
local Part = game.Workspace.MediterraneanAvenue local function playerHasTool(player, toolName) local tool = player.Backpack:FindFirstChild(toolName) or player.Character:FindFirstChild(toolName) if tool then return true else return false end end playerHasTool() local Player Part.Touched:Connect(function(HIT) Player = game.Players:GetPlayerFromCharacter(HIT.Parent) local H = HIT.Parent:FindFirstChild("Humanoid") if H and not game.ReplicatedStorage:FindFirstChild("MediterraneanAvenue") and not playerHasTool(Player,"MediterraneanAvenue") then print("Conditional recognized.") script.Parent.Visible = true end end)