dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
|
| 10 Nov 2013 04:22 AM |
button = script.Parent
function onTouch(part) if (player == nil) then return end local stats = player:findFirstChild("leaderstats") local sp = stats:findFirstChild("Lvl") if sp == nil then return false end if (sp.Value >= lvl.Value) then local player = game.Players:GetPlayerFromCharacter(part.Parent) if player ~= nil then local GUI = game.Lighting:FindFirstChild(script.Parent.Something.Value) local AlreadyHaveGUI = player.PlayerGui:FindFirstChild(script.Parent.something.Value) if AlreadyHaveGUI == nil then GUI:Clone()Game.Lighting.levellava = player.PlayerGui else print("Already have GUI!") wait(3) player.PlayerGui.levellava:Remove() end end end end button.Touched:connect(onTouch)
what is wrong whit this script? this script should do that if you go to a lvl door and you are to low lvl a gui will pop up for 3 sec saying you are too low lvl i just mixed up 2 script but whats wrong? help |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 10 Nov 2013 04:36 AM |
button = script.Parent local lvl = 0 --put the level here!
function onTouch(part) local player = game.Players:GetPlayerFromCharacter(part.Parent) if player then local stats = player:findFirstChild("leaderstats") local sp = stats:findFirstChild("Lvl") if sp then if (sp.Value >= lvl) then local GUI = game.Lighting:FindFirstChild(script.Parent.Something.Value) local AlreadyHaveGUI = player.PlayerGui:FindFirstChild(script.Parent.something.Value) if AlreadyHaveGUI == nil then GUI:Clone()Game.Lighting.levellava = player.PlayerGui else print("Already have GUI!") wait(3) player.PlayerGui.levellava:remove() end end end button.Touched:connect(onTouch)
try that and tell me the output |
|
|
| Report Abuse |
|
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
|
| 10 Nov 2013 10:11 AM |
| W o r k s p a c e . L e v e l D o o r . D o o r . D o o r . S c r i l i n e 6 ) n e a r ' < e o f > ' p t : 2 2 : ' e n d ' e x p e c t e d ( t o c l o s e ' i f ' a t |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
|
| 10 Nov 2013 10:45 AM |
7:36:58.994 - Touched is not a valid member of StringValue 17:36:58.994 - Script 'Workspace.Level Door.Door.Door.something.Script', Line 23 17:36:58.995 - stack end |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
|
| 11 Nov 2013 08:54 AM |
| button.Touched:connect(onTouch) |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
|
| 11 Nov 2013 10:17 AM |
| The script is inside a StringValue; It needs to be inside a BasePart. |
|
|
| Report Abuse |
|
|
dave448
|
  |
| Joined: 28 Feb 2009 |
| Total Posts: 36 |
|
|
| 12 Nov 2013 09:46 AM |
16:45:09.794 - Workspace.Level Door.Door.Door.Script:8: attempt to index local 'stats' (a nil value) 16:45:09.795 - Script 'Workspace.Level Door.Door.Door.Script', Line 8 16:45:09.796 - stack end 16:45:09.796 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|