Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it to where when a player sits on the seat GUI pops up on their screen?

Asked by 10 years ago

How do I make it to where when a player sits on the seat GUI pops up on their screen? This is as far as I've gotten knowing what I know at the moment.

1player = game.Players:GetPlayerFromCharacter(script.Parent)
2 
3script.Parent.Touched:connect(function(hit)
4    if player then
5 
6    end
7end)

I don't know if this is all correct. Let me know what I should do and if you could, tell me what part(s) in scripting I should learn so next time when I want to do something like this I know exactly what to do. Thanks

1 answer

Log in to vote
0
Answered by
Ulysies 50
10 years ago

Try this it should work.

01put = script.Parent.Input
02s = script.Parent
03 
04bounce = false
05 
06function t(p)
07if bounce == true then return end
08bounce = true
09    local h = p.Parent:findFirstChild("Humanoid")
10        if h ~= nil then
11            gui = put:GetChildren()
12                for i=1, #gui do
13                    if gui[i].className == "ScreenGui" then
14                        x = gui[i]:clone()
15                        player = game.Players:GetPlayerFromCharacter(p.Parent)
View all 28 lines...
0
When you say "bounce = false function t(p) if bounce == true then return end" What does that do? I'm confused. notes4u99 65 — 10y
0
It means if bounce is true duble check Ulysies 50 — 10y
0
Also 1) When you put "gui[i].className" What are the Brackets for? 2) When you say "for i=1, #gui do" What is the # for and what does it do? 3) The first variable you said "put = script.Parent.Input" What is Input and what is it for? notes4u99 65 — 10y
0
okay, first I messed up. If bounce is true end the script right there and go to the next variable. 1) This script was intended for a computer. 2) Its gust a variable nothing special. 3) as I said before this was ment for a computer Ulysies 50 — 10y
View all comments (6 more)
0
Edit what you dont want. Its just what I had Ulysies 50 — 10y
0
You make no sense to me. I was asking questions so I could understand what your writing, but I don't so can you please answer my questions? Also i'm a beginner Scripter if you don't already know and I need to know these things. notes4u99 65 — 10y
0
Make sure to put that script into the a seat Ulysies 50 — 10y
0
I will, but can you tell me what going on in the script so I know what's happening? notes4u99 65 — 10y
0
Okay. I designed this script for a computer. This will work without the computer, just place this script into a "seat" and that seat into whatever you want. Now for the questions, 1) That is saying once the player has sat in his seat the "ScreanGui" will start up. 2) By saying this we are telling the script to use gui 1.(Just for the specifics) 3) The input is the screen gui, for example your fi Ulysies 50 — 10y
0
for example your screenGUI is in input witch is in seat Ulysies 50 — 10y
Ad

Answer this question