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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: How do i fix this error

Previous Thread :: Next Thread 
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:19 PM
attempt to index global 'player' (a nil value)

i marked the line of the error and this is the script:

-- going to see if this one is better

wait(10)

while true do
wait(5)
players = game.Players.NumPlayers
games = game.ServerStorage.Games:GetChildren()
player = game.Players.LocalPlayer
val = game.Workspace.Topval

if players >= 1 then
wait(1)
rangame = math.random(1, #games)
minigamech = games[rangame]
minigamec = minigamech:Clone()
minigamec.Parent = game.Workspace
spawns = minigamec.Spawns:GetChildren()
for i, v in pairs(game.Players:GetChildren()) do
Pame = v.Name
checkName = game.Workspace:FindFirstChild(Pame)
if checkName then
checkHumanoid = checkName:FindFirstChild("Humanoid")
if checkHumanoid then
checkName:MoveTo(spawns[i].Position)
end
end
end
wait(2.2)
pie = game.Lighting.Winner:clone()
pie.Parent = player
for i = 9, 6, -1 do
game.Workspace.Topval.Value = "Time Left "..i
wait(1)
end
if player.Winner then -- THIS IS THE LINE
done = math.random(10,50)
player.stats.cash.Value=player.stats.cash.Value+(done)
for i = 5, 1, -1 do
game.Workspace.Topval.Value = "Time Left "..i
wait(1)
end
game.Workspace.Topval.Value = "Time Left "..i
else

end
minigamec:remove()
end

end


Report Abuse
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:25 PM
Bump
Report Abuse
powerhotmail123 is not online. powerhotmail123
Joined: 11 Apr 2011
Total Posts: 5041
31 Jul 2015 03:26 PM
You're using LocalPlayer in a serverscript.

Did you even make this script?

Enjoying your stay at the Scripters Forum? Join this! http://www.roblox.com/My/Groups.aspx?gid=2582784
Report Abuse
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:27 PM
Yes i did but can i not use localplayer in it?
Report Abuse
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:31 PM
BUMP!
Report Abuse
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:38 PM
Bump
Report Abuse
nicebros is not online. nicebros
Joined: 17 Jun 2011
Total Posts: 102
31 Jul 2015 03:53 PM
bump
Report Abuse
twister1976 is not online. twister1976
Joined: 17 Sep 2010
Total Posts: 2250
31 Jul 2015 04:01 PM
'game.Players.LocalPlayer' cannot be used inside of a server script.

If money grew on trees... It would be as valuable as leaves. | Twitter: @TwisterRBLX
Report Abuse
Optimxl is not online. Optimxl
Joined: 26 Feb 2011
Total Posts: 9430
31 Jul 2015 04:05 PM
i'm a fairly new scripter, but i dont think you can do local scripts. but if you can the issue might be the .Winner it might need to be = Winner or Winner = true
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