function onTouch(Part)
wait(1)
game.StarterGui.ScreenGui.Frame.Visible = true
wait(1)
end
script.Parent.Touched:connect(onTouch)
COMMUNITY QUESTION
When u sit on a seat and a gui pop up(onTouch) help?
1 answer
This hasn't been tested.
script.Parent.Touched:connect(function(hit)
local hitplayer = game.Players:GetPlayerFromCharacter(hit.Parent) -- we must somehow get the player
if (hitplayer) then -- if what hit it was a player then
local screengui = hitplayer.PlayerGui:FindFirstChild("ScreenGui") -- defining the 'ScreenGui'
if (screengui) then -- if there a is 'ScreenGui' then
screengui.Frame.Visible = true -- making the frame visible
wait (4)
screengui.Frame.Visible = false -- making the frame invisible
end
end
end)
Hope it works for ya!
This discussion is preserved as it was. New answers, comments, and votes are closed.
