Hello Developers!
I am having trouble with a script that is not working. It is supposed to do when I touch I part a gui pops up. I got an error of missing “End” so I looked over the script but the end for the “if then” was there. Any ideas?
local part = script.Parent
local players = game:GetService("Players")
part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local character = hit.Parent
local player = players:GetPlayerFromCharacter(character)
local playerGui = player:WaitForChild("PlayerGui")
local screenGui = playerGui:WaitForChild("ScreenGui")
local frame = screenGui:WaitForChild("Frame")
local nextframe = frame:WaitForChild("NextFrame")
local nextbutton = nextframe:WaitForChild("NextButton")
local talktext = frame:FindFirstChild("TalkText")
frame.Position = UDim2.new(0, 0,1.2, 0)
wait(0.1)
frame:TweenPosition(UDim2.new(0, 0,0.73, 0), "Out", "Back")
end