|
| 12 Feb 2017 11:13 AM |
Hei Guys :D
I'm trying to make a Gui that a Player can see when he has touched a brick. He should see it until a minigame ends. Can anyone help me please?
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:16 AM |
part.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humannoid") then local player = game.Players:GetPlayerFromCharacter(hit.Parent) player.PlayerGui.something.Visible = true end end |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:18 AM |
local minigameover = false
script.Parent.Touched:connect(function(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player and not minigameover then if minigameover then repeat wait() until player.PlayerGui repeat wait() until player.PlayerGui.ScreenGui repeat wait() until player.PlayerGui.ScreenGui.TextLabel player.PlayerGui.ScreenGui.TextLabel.Visible = true wait(10) player.PlayerGui.ScreenGui.TextLabel.Visible = false end end end) |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:18 AM |
^ that's error-prone, just check if what GetPlayerFromCharacter returns is nil
|
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Feb 2017 11:23 AM |
reason why it would leave an error.
You spelt Humanoid wrong Kritikal |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:23 AM |
that's not the only reason i ignored that because it's an obvious typo
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:36 AM |
| No because it checks if there is a humanoid in the hit tho so it should be fine |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:38 AM |
really? what about NPCs? or even other objects that just have Humanoids so a name can appear above them? when you try call GetPlayerFromCharacter() on it then try to do stuff it'll error
not to mention you're accessing PlayerGui from a Script...
|
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:40 AM |
| *assuming that he is not using fe and npc's in his game. Takes like 2 ### to fix |
|
|
| Report Abuse |
|
|
|
| 12 Feb 2017 11:41 AM |
they don't have to be NPCs and checking for both the Humanoid and calling GetPlayerFromCharacter is unnecessary
you should get into the habit of scripting everything for FE/instead of trying to access PlayerGui from the server, tell OP what they need to do
|
|
|
| Report Abuse |
|
|