|
| 30 Jun 2012 02:47 PM |
function onChildAdded(child) if child.Name == "SeatWeld" then game.StarterGui.ScreenGui.TextLabel.Visible = true end end
script.Parent.ChildAdded:connect(onChildAdded) |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 02:48 PM |
| There is no error in the output |
|
|
| Report Abuse |
|
|
| |
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:00 PM |
| Why not just make it a .Touched and then remove with a .TouchEnded? |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 03:02 PM |
I have also tried that, and that doesn't work either. Here is what I did for the onTouched(hit)
function onTouched(hit) game.StarterGui.ScreenGui.TextLabel.Visible = true end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:06 PM |
| You realize that you are trying to change something in the StarterGui and not the PlayerGui right? |
|
|
| Report Abuse |
|
|
| |
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 30 Jun 2012 03:09 PM |
| For the player's name do I use LocalPlayer or plyrname? |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 03:12 PM |
| Or something completely different? ^ |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:15 PM |
Here's how I would do it:
local seat = script.Parent seat.Touched:connect(function(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h then local char = hit.Parent local plyr = game.Players:GetPlayerFromCharacter(char) plyr.PlayerGui.ScreenGui.TextLabel.Visible = true end end) |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 30 Jun 2012 03:17 PM |
| I have absolutely no idea what any of that means, but you've helped me with all of my problems so far and they've all worked, so I'll just take your word for it :3 |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:20 PM |
Lol lemme break this down for you.
local seat = script.Parent --Derp seat.Touched:connect(function(hit) --Function right here with connection line in one line local h = hit.Parent:FindFirstChild("Humanoid") --Checks to see if whatever touched the seat has a humanoid in it if h then --If it is then local char = hit.Parent --Character in game local plyr = game.Players:GetPlayerFromCharacter(char) --Gets thePlayerFromCharacter basically lets you get the Player name from character like how you could by using game.Players.PlayerName.Character plyr.PlayerGui.ScreenGui.TextLabel.Visible = true --Derpy end --Ends if end) --Ends function/event |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 03:23 PM |
Thank you, it works great! But now, the second part of the script: removing the gui. This is the suggestion I got the other day, would this work?
ply.Character.Humanoid.Jumping:connect(function() Frame.Visible = false end) |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 03:27 PM |
| I tried it, it didn't work. What's wrong with it? |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:28 PM |
Place it all under one script.
local seat = script.Parent ---[[Touched Event]] seat.Touched:connect(function(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h then local char = hit.Parent local plyr = game.Players:GetPlayerFromCharacter(char) plyr.PlayerGui.ScreenGui.TextLabel.Visible = true end end) ---[[ToucheEnded Event]] seat.TouchEnded:connect(function(hit) local h = hit.Parent:FindFirstChild("Humanoid") if h then local char = hit.Parent local plyr = game.Players:GetPlayerFromCharacter(char) plyr.PlayerGui.ScreenGui.TextLabel.Visible = false end end)
Basically the same script twice. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:28 PM |
| It didn't work because ply and Frame weren't declared. |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 03:39 PM |
Yet again, WhiteRain is here to save me from being eaten up by my own stupidity.
Thank you so much. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
|
| 30 Jun 2012 03:40 PM |
| It happens to all of us from time to time. |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 30 Jun 2012 03:49 PM |
| Give it half an hour and I'll probably have another problem :L |
|
|
| Report Abuse |
|
|
WhiteRain
|
  |
| Joined: 24 Apr 2010 |
| Total Posts: 2723 |
|
| |
|
|
| 30 Jun 2012 04:03 PM |
Haha, didn't even last half an hour.
I'm having trouble with the indicators/blinkers (brickcolor issue). The scripts don't work, as expected; I've never done BrickColor before.
--On Gui:
while true do game.Workspace.Plymouth.ModelBody.IndicatorL.BrickColor.new(Br. yellowish orange) game.Workspace.Plymouth.ModelBody.IndicatorR.BrickColor.new(Br. yellowish orange) wait(0.5) game.Workspace.Plymouth.ModelBody.IndicatorL.BrickColor.new(Mid gray) game.Workspace.Plymouth.ModelBody.IndicatorR.BrickColor.new(Mid gray) end
--Off Gui:
function game.Workspace.Plymouth.ModelBody.IndicatorL.BrickColor.new(Mid gray) game.Workspace.Plymouth.ModelBody.IndicatorR.BrickColor.new(Mid gray) end
|
|
|
| Report Abuse |
|
|