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: How do i fix this to make a h.Text show up?

Previous Thread :: Next Thread 
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:30 AM
This script works but h.Text will not show up, it says this:
09:29:52.985 - Message is not a valid member of PlayerGui
My Leaderboard has a stat called "Points"

local debounce = true

function onTouched(part)
if part.Parent == nil then return end
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
if h.Health == 0 then return end
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local cash = thisplr:findFirstChild(script.Parent.Parent.Name)
if (cash == nil) and (debounce == true) then
if thisplr == nil then return end
debounce = false
thisplr.Checkpoint.Value = Vector3.new(-1,-1,-1)
thisplr.leaderstats.Tokens.Value = thisplr.leaderstats.Tokens.Value + 1
local c = Instance.new("ObjectValue")
c.Parent = thisplr
if thisplr == nil then return end
c.Name = script.Parent.Parent.Name
local h = thisplr.PlayerGui.Message.msg1
h.Visible = true
h.Text = script.Parent.Parent.StarDes.Value
wait(4)
if thisplr == nil then return end
h.Visible = false
debounce = true
if (script.Parent.Parent.Return.Value == true) then
if thisplr.Character == nil then return end
local b = game:GetService("BadgeService")
b:AwardBadge(thisplr.userId, script.Parent.BadgeID.Value)
if thisplr == nil then return end
if thisplr.Character == nil then return end
thisplr.Character:MoveTo(Vector3.new(game.Workspace.AdventureScript.StartPos.Value.x+math.random(-2,2),game.Workspace.AdventureScript.StartPos.Value.y+8,game.Workspace.AdventureScript.StartPos.Value.z+math.random(-2,2)))
wait(0.1)
thisplr.Character.Torso.Anchored = true
thisplr.Character.Head.Anchored = true
wait(0.5)
thisplr.Character.Torso.Anchored = false
thisplr.Character.Head.Anchored = false
end
else if (debounce == true) then
if thisplr == nil then return end
debounce = false
if thisplr == nil then return end
thisplr.Checkpoint.Value = Vector3.new(-1,-1,-1)
local h = thisplr.PlayerGui.Message.msg1
h.Visible = true
h.Text = "You already got this token."
wait(4)
if thisplr == nil then return end
h.Visible = false
debounce = true
if (script.Parent.Parent.Return.Value == true) then
if thisplr.Character == nil then return end
thisplr.Character:MoveTo(Vector3.new(game.Workspace.AdventureScript.StartPos.Value.x+math.random(-2,2),game.Workspace.AdventureScript.StartPos.Value.y+8,game.Workspace.AdventureScript.StartPos.Value.z+math.random(-2,2)))
wait(0.1)
thisplr.Character.Torso.Anchored = true
thisplr.Character.Head.Anchored = true
wait(0.5)
thisplr.Character.Torso.Anchored = false
thisplr.Character.Head.Anchored = false
end
end
end
end
end
end

script.Parent.Touched:connect(onTouched)


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:31 AM
Anyone who can help me?


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
02 May 2015 09:32 AM
Don't bump every minute

Use :WaitForChild()
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:34 AM
woops, small mistake!

local debounce = true

function onTouched(part)
if part.Parent == nil then return end
local h = part.Parent:findFirstChild("Humanoid")
if (h~=nil) then
if h.Health == 0 then return end
local thisplr = game.Players:findFirstChild(h.Parent.Name)
if (thisplr~=nil) then
local cash = thisplr:findFirstChild(script.Parent.Parent.Name)
if (cash == nil) and (debounce == true) then
if thisplr == nil then return end
debounce = false
thisplr.Checkpoint.Value = Vector3.new(-1,-1,-1)
thisplr.leaderstats.Points.Value = thisplr.leaderstats.Points.Value + 1
local c = Instance.new("ObjectValue")
c.Parent = thisplr
if thisplr == nil then return end
c.Name = script.Parent.Parent.Name
local h = thisplr.PlayerGui.Message.msg1
h.Visible = true
h.Text = script.Parent.Parent.StarDes.Value
wait(4)
if thisplr == nil then return end
h.Visible = false
debounce = true
if (script.Parent.Parent.Return.Value == true) then
if thisplr.Character == nil then return end
local b = game:GetService("BadgeService")
b:AwardBadge(thisplr.userId, script.Parent.BadgeID.Value)
if thisplr == nil then return end
if thisplr.Character == nil then return end
thisplr.Character:MoveTo(Vector3.new(game.Workspace.AdventureScript.StartPos.Value.x+math.random(-2,2),game.Workspace.AdventureScript.StartPos.Value.y+8,game.Workspace.AdventureScript.StartPos.Value.z+math.random(-2,2)))
wait(0.1)
thisplr.Character.Torso.Anchored = true
thisplr.Character.Head.Anchored = true
wait(0.5)
thisplr.Character.Torso.Anchored = false
thisplr.Character.Head.Anchored = false
end
else if (debounce == true) then
if thisplr == nil then return end
debounce = false
if thisplr == nil then return end
thisplr.Checkpoint.Value = Vector3.new(-1,-1,-1)
local h = thisplr.PlayerGui.Message.msg1
h.Visible = true
h.Text = "You already got this token."
wait(4)
if thisplr == nil then return end
h.Visible = false
debounce = true
if (script.Parent.Parent.Return.Value == true) then
if thisplr.Character == nil then return end
thisplr.Character:MoveTo(Vector3.new(game.Workspace.AdventureScript.StartPos.Value.x+math.random(-2,2),game.Workspace.AdventureScript.StartPos.Value.y+8,game.Workspace.AdventureScript.StartPos.Value.z+math.random(-2,2)))
wait(0.1)
thisplr.Character.Torso.Anchored = true
thisplr.Character.Head.Anchored = true
wait(0.5)
thisplr.Character.Torso.Anchored = false
thisplr.Character.Head.Anchored = false
end
end
end
end
end
end

script.Parent.Touched:connect(onTouched)


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:35 AM
@rayk999
where?


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:48 AM
bump


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 09:56 AM
bump


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 10:07 AM
bump


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
KorniakRBLX is not online. KorniakRBLX
Joined: 09 Aug 2013
Total Posts: 858
02 May 2015 10:09 AM
Mg, if you keep bumping, no one will help you.
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 10:17 AM
this forum is dead


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
02 May 2015 10:21 AM
The code is way too long
Report Abuse
Duckywow is not online. Duckywow
Joined: 24 Oct 2013
Total Posts: 6110
02 May 2015 10:32 AM
@time
a code can never be too long


( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一
Report Abuse
XtremeTemper is not online. XtremeTemper
Joined: 02 Mar 2012
Total Posts: 1774
02 May 2015 11:29 AM
You cant access a player's GUI from the server, you have to access it from the client.
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