The error Workspace.Part.Script:15: Ambiguous syntax: this looks like an argument list for a function call, but could also be a start of new statement Im trying to make a frame visible on touch with a script
The script in the Part:
local part = script.Parent
part.Touched:Connect(
function(hit)
hit.Parent.HumanoidRootPart.Anchored = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
plr:FindFirstChild("PlayerGui").Quest1.Frame.Visible = true
plr:FindFirstChild("PlayerGui").Quest1.Frame.Visible = true
wait(0.1)
plr:FindFirstChild("PlayerGui").Quest1.Frame:WaitForChild("TextLabel").Visible = true
wait(0.1)
plr:FindFirstChild("PlayerGui").Quest1.Frame.TextLabel.Text =
("Hey, can you find my teddy bear? I lost it *is sad*")
wait(3)
("PlayerGui").Quest1.Frame.Where is it?.Visible = true
("PlayerGui").Quest1.Frame.Goodbye!.Visible = true
wait(0.1)
("PlayerGui").Quest1.Frame.Where is it?.Text = ("Where is it?")
("PlayerGui").Quest1.Frame.Goodbye!.Text = ("Goodbye!")
end
end
)
part.TouchEnded:Connect(
function(hit)
hit.Parent.HumanoidRootPart.Anchored = true
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
plr:FindFirstChild("PlayerGui").Quest1.Frame.Visible = false
end
)
