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: I HAVE NOT CLUE.........

Previous Thread :: Next Thread 
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 10:11 AM
I made this script but idk how to fix this... 11:09:03.136 - Workspace.Script:6: bad argument #3 to 'Name' (string expected, got nil)
11:09:03.137 - Script 'Workspace.Script', Line 6
11:09:03.137 - Stack End

(I need the name SecLevel)



Script: function onPlayerEntered(newPlayer)
if newPlayer.Name == ("Player1") then
AccessLevel = Instance.new("NumberValue")
AccessLevel.Value = 3
AccessLevel.Parent = newPlayer.PlayerScripts
AccessLevel.Name = SecLevel
end
end
game.Players.ChildAdded:connect(onPlayerEntered)


Over and out!
Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 10:12 AM
Try doing this:

AccessLevel.Name = "SecLevel"

To make the name a string.
Report Abuse
DeGames is not online. DeGames
Joined: 08 Sep 2012
Total Posts: 1028
16 Jul 2016 10:13 AM
try


game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 10:14 AM
Thank you... I cant believe I didnt see that.


Over and out!
Report Abuse
DeGames is not online. DeGames
Joined: 08 Sep 2012
Total Posts: 1028
16 Jul 2016 10:14 AM
actually ignore what i said, your method works too for when a player joins
Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 10:15 AM
No problem. I make those mistakes like literally all the time.
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 10:16 AM
Lol, Thanks anyways


Over and out!
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 10:30 AM
Okay... It works on stuido but when I join the game it doesnt work......


function onPlayerEntered(newPlayer)
if newPlayer.Name == ("stephenthefox") then
AccessLevel = Instance.new("NumberValue")
AccessLevel.Value = 1
AccessLevel.Name = "SecLevel"
AccessLevel.Parent = newPlayer.PlayerScripts

end
end
game.Players.ChildAdded:connect(onPlayerEntered)


Over and out!
Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 10:58 AM
Change this: game.Players.ChildAdded:connect(onPlayerEntered)

To this: game.Players.PlayerAdded:connect(onPlayerEntered)
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:07 AM
^ i love you again
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:07 AM
o wait, nevermind
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:09 AM
game.Players.ChildAdded:connect(function(plr)
if plr.Name == ("Player1") then
AccessLevel = Instance.new("NumberValue")
AccessLevel.Value = 3
AccessLevel.Parent = plr.PlayerScripts
AccessLevel.Name = "SecLevel"
end
end)
Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 11:14 AM
The parameter doesn't really matter. He is using it right :P
Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 11:15 AM
*doesn't need to change
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 11:16 AM
xx your way didnt work in studio... But the other guys worked in studio but not in game... So neither worked


Over and out!
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:18 AM
Use xX's, even tho it doesn't work it studio, it's not like everyone will be playing in studio. It's probably because you don't have any waits going where you might need them

Report Abuse
xXLegendarySoldierXx is not online. xXLegendarySoldierXx
Joined: 22 Mar 2012
Total Posts: 551
16 Jul 2016 11:18 AM
Please tell me you aren't relying on Play Solo for this right? If so, use Test Server. It makes an actual server and you can see whats wrong.
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:19 AM
game.Players.ChildAdded:connect(function(plr)
wait() --Doesn't hurt to plop these in
if plr.Name == ("stephenthefox") then --This isn't going to work in game because it's player1 and not your actual self.
wait(0.1)
AccessLevel = Instance.new("NumberValue")
AccessLevel.Value = 3
AccessLevel.Parent = plr.PlayerScripts
AccessLevel.Name = "SecLevel"
end
end)
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:20 AM
~i fixed the player1 thing, but i also added the comment~
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 11:38 AM
I tried all of your scripts in the server test thing... Change the name to the Player1.
But non of them add the NumberValue


Over and out!
Report Abuse
VisualGraphics is not online. VisualGraphics
Joined: 26 Nov 2010
Total Posts: 6515
16 Jul 2016 11:44 AM
local plrs = game:GetService("Players")

plrs.PlayerAdded:connect(function(plr)
if plr ~= nil and plr.Name == "stephenthefox" then
local AccessLevel = Instance.new("NumberValue")
AccessLevel.Parent = plr.PlayerScripts
AccessLevel.Name = "SecLevel"
AccessLevel.Value = 3
end
end)
Report Abuse
NathanTheDeveloper is not online. NathanTheDeveloper
Joined: 14 Feb 2016
Total Posts: 228
16 Jul 2016 11:45 AM
^
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 11:47 AM
It still doesnt add it



Over and out!
Report Abuse
VisualGraphics is not online. VisualGraphics
Joined: 26 Nov 2010
Total Posts: 6515
16 Jul 2016 11:51 AM
it should work, perhaps changing "stephenthefox" to "Player1" if you're in studios?
Report Abuse
stephenthefox is not online. stephenthefox
Joined: 11 Mar 2011
Total Posts: 1123
16 Jul 2016 11:54 AM
I did...


Over and out!
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