generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: A ScreenGui for only "this" Player

Previous Thread :: Next Thread 
DannyJesden112 is not online. DannyJesden112
Joined: 15 Jan 2017
Total Posts: 229
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
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
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
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Feb 2017 11:18 AM
^ that's error-prone, just check if what GetPlayerFromCharacter returns is nil


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Feb 2017 11:18 AM
@kritikal


Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
12 Feb 2017 11:23 AM
reason why it would leave an error.

You spelt Humanoid wrong Kritikal
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
12 Feb 2017 11:23 AM
that's not the only reason
i ignored that because it's an obvious typo


Report Abuse
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
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
KritikalGunzz is not online. KritikalGunzz
Joined: 10 Nov 2013
Total Posts: 1633
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
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image