For example
if HumanoidIsFound and PlayerIsFound then
I am having troubles understanding the if and then concepts using an wait(). I have read wiki articles as well as Roblox Blogs on the If and then and wait, although I still can not understand how to place all three together in a single function.
The line im working with---
if HumanoidIsFound and PlayerIsFound then PlayerIsFound.PlayerGui.ScreenGui.TextButton.Visible = true end end
If necessary to understand what I mean here is the script im working with------
local p = script.Parent function onTouch(part) local HumanoidIsFound = part.Parent:FindFirstChild("Humanoid") local PlayerIsFound = game.Players:GetPlayerFromCharacter(part.Parent) if HumanoidIsFound and PlayerIsFound then PlayerIsFound.PlayerGui.ScreenGui.TextButton.Visible = true end end p.Touched:connect(onTouch)
Never mind I Figured it out lol... Im dumb.
local p = script.Parent function onTouch(part) local HumanoidIsFound = part.Parent:FindFirstChild("Humanoid") local PlayerIsFound = game.Players:GetPlayerFromCharacter(part.Parent) if HumanoidIsFound and PlayerIsFound then PlayerIsFound.PlayerGui.ScreenGui.TextButton.Visible = true wait(3) PlayerIsFound.PlayerGui.ScreenGui.TextButton.Visible = false end end p.Touched:connect(onTouch)
Locked by BlueTaslem
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?