|
| 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 |
|
|
|
| 16 Jul 2016 10:12 AM |
Try doing this:
AccessLevel.Name = "SecLevel"
To make the name a string. |
|
|
| Report Abuse |
|
|
DeGames
|
  |
| Joined: 08 Sep 2012 |
| Total Posts: 1028 |
|
|
| 16 Jul 2016 10:13 AM |
try
game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 10:14 AM |
Thank you... I cant believe I didnt see that.
Over and out! |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 16 Jul 2016 10:15 AM |
| No problem. I make those mistakes like literally all the time. |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 10:16 AM |
Lol, Thanks anyways
Over and out! |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 16 Jul 2016 10:58 AM |
Change this: game.Players.ChildAdded:connect(onPlayerEntered)
To this: game.Players.PlayerAdded:connect(onPlayerEntered) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 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 |
|
|
|
| 16 Jul 2016 11:14 AM |
| The parameter doesn't really matter. He is using it right :P |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 16 Jul 2016 11:20 AM |
| ~i fixed the player1 thing, but i also added the comment~ |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
|
| 16 Jul 2016 11:47 AM |
It still doesnt add it
Over and out! |
|
|
| Report Abuse |
|
|
|
| 16 Jul 2016 11:51 AM |
| it should work, perhaps changing "stephenthefox" to "Player1" if you're in studios? |
|
|
| Report Abuse |
|
|
| |
|