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: idk whats wrong

Previous Thread :: Next Thread 
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:04 PM
Error: Workspace.Script:3: attempt to index local 'player' (a nil value)

What my script is suppose to do is it's made to make a wall able to walk through if they're an HR. I've tested it a couple times and then it broke.

local player = game.Players.LocalPlayer

if player:GetRankInGroup(2952420) >= 40 then
game.Workspace.InvisibleTrainerWall.CanCollide = false
end
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:09 PM
bump
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
16 Dec 2016 11:10 PM
Well, eh after a while don't you want it to close again?? Plus you might have to put a WaitForChild() in there.

local player = game.Players.LocalPlayer
local Wall = game.Workspace:WaitForChild("InvisibleTrainerWall")

if player:GetRankInGroup(2952420) >= 40 then
Wall.CanCollide = false
wait(5)
Wall.CanCollide = true
end
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:12 PM
omg i put that in a script i used in my other place...
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:20 PM
doesn't work. Still says play is a nil value
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
16 Dec 2016 11:20 PM
What.
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
16 Dec 2016 11:21 PM
What do you mean play? Is that the entire script?
Report Abuse
dudefun1234 is not online. dudefun1234
Joined: 21 Jul 2013
Total Posts: 3038
16 Dec 2016 11:22 PM


local player = game.Players.LocalPlayer
repeat wait() until game.Players.LocalPlayer ~= nil and game.Players.LocalPlayer.Character ~= nil
local Wall = game.Workspace:WaitForChild("InvisibleTrainerWall")



if player:GetRankInGroup(2952420) >= 40 then
Wall.CanCollide = false
wait(5)
Wall.CanCollide = true
end
Report Abuse
WoolHat is online. WoolHat
Joined: 19 May 2013
Total Posts: 1873
16 Dec 2016 11:27 PM
Sounds like you're using a server script. Server scripts cannot access a local player, as they are owned and operated by the server
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:29 PM
doesn't work
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:30 PM
@Wool I should've known that..
Report Abuse
Astranite is not online. Astranite
Joined: 01 Dec 2016
Total Posts: 562
16 Dec 2016 11:30 PM
No need for the repeat loop. Quite possible you're using a script as opposed to a LocalScript, as others have mentioned.


Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:41 PM
do you know how to create it from a local script because when I'm doing it, it's not even working.
Report Abuse
coolrobertrules99 is not online. coolrobertrules99
Joined: 30 Apr 2012
Total Posts: 359
16 Dec 2016 11:52 PM
nvm i got it
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