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
|
  |
| 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
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 02 May 2015 09:32 AM |
Don't bump every minute
Use :WaitForChild() |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 02 May 2015 09:35 AM |
@rayk999 where?
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 02 May 2015 09:48 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 02 May 2015 09:56 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
Duckywow
|
  |
| Joined: 24 Oct 2013 |
| Total Posts: 6110 |
|
|
| 02 May 2015 10:07 AM |
bump
( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 Insert stupid siggy here ( ͠° ͟ʖ ͡°)-▄︻̷̿┻̿═━一 |
|
|
| Report Abuse |
|
|
|
| 02 May 2015 10:09 AM |
| Mg, if you keep bumping, no one will help you. |
|
|
| Report Abuse |
|
|
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
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
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 |
|
|
|
| 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 |
|
|