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 » Scripting Helpers
Home Search
 

Re: Help script

Previous Thread :: Next Thread 
dave448 is not online. 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 is not online. 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 is not online. dave448
Joined: 28 Feb 2009
Total Posts: 36
10 Nov 2013 10:08 AM
test
Report Abuse
dave448 is not online. 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 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
10 Nov 2013 10:13 AM
Add in another end.
Report Abuse
dave448 is not online. dave448
Joined: 28 Feb 2009
Total Posts: 36
10 Nov 2013 10:14 AM
ok
Report Abuse
dave448 is not online. dave448
Joined: 28 Feb 2009
Total Posts: 36
10 Nov 2013 10:24 AM
still dont work
Report Abuse
dave448 is not online. dave448
Joined: 28 Feb 2009
Total Posts: 36
10 Nov 2013 10:24 AM
nofing in output
Report Abuse
dave448 is not online. 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 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
10 Nov 2013 11:22 AM
What is line 23?
Report Abuse
dave448 is not online. dave448
Joined: 28 Feb 2009
Total Posts: 36
11 Nov 2013 08:54 AM
button.Touched:connect(onTouch)
Report Abuse
smiley599 is not online. 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 is not online. 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 is not online. smiley599
Joined: 23 Jan 2010
Total Posts: 21869
12 Nov 2013 01:18 PM
no idea
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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