RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 01:54 PM |
Why does this:
if game.Players:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value).TotalDrones.Value == 1 then
say it's a nil value?
"Owner" is a StringValue with the name of the player in it. TotalDrones is in the player
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 02:31 PM |
Any help why it does that?
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 02:35 PM |
error: "Attempt to index a nil value"
But it does exist so why does it say it's a nil value?
--RoKjell-- |
|
|
| Report Abuse |
|
|
imalex4
|
  |
| Joined: 16 Aug 2012 |
| Total Posts: 48 |
|
|
| 06 Sep 2015 02:40 PM |
| There is not enough info for us to help. I don't know what script or parent or TotalDrones is. Also, I don't know what you mean by "Owner is a StringValue with the name of the player in it." How does a string value store something like that? This question is really confusing. |
|
|
| Report Abuse |
|
|
|
| 06 Sep 2015 02:43 PM |
total drones ⊙ ͜ʖ ͡⊙
When the beat drops I'm like: ( ͡° ͜ʖ ͡°) ( ͡⊙ ͜ʖ ͡⊙) ( ͡◉ ͜ʖ ͡◉) |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 02:54 PM |
script:
while true do wait() if game.Players:FindFirstChild(script.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value).TotalDrones.Value == 1 then script.Parent.Drone1.Visible = true end end
TotalDrones is an intValue stored in the player, will later be able to save.
Family Tree:
Tycoon1 (model) Owner (StringValue) -- The name of the owner of that tycoon is in here. HeadComputer (part) SurfaceGui MainFrame (Frame) HeadComputer (Frame) SendDrones (Frame) DroneVisible (The script)
Ask me if you need more info
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 03:18 PM |
Cmone, someone must know it
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
|
| 06 Sep 2015 04:08 PM |
try key = script.Parent.Parent.Parent.Parent.Parent.Parent.Owner.Value if game.Players:FindFirstChild(key)and game.Players:FindFirstChild(key).TotalDrones.Value == 1 then |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 06 Sep 2015 04:25 PM |
That part seems to work now but this thing doesnt.
wait(1) key = script.Parent.Parent.Value script.Parent.Value = game.Players:FindFirstChild(key).TotalDrones.Value
This is inside that Owner Value
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
| |
|
Quebankus
|
  |
| Joined: 25 Aug 2011 |
| Total Posts: 846 |
|
|
| 07 Sep 2015 01:05 AM |
script.Parent.Parent.Parent.Parent.Parent.Parent
start fixing this please
--Quebankus |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 07 Sep 2015 09:42 AM |
What's wrong about that? It only means there are many parents.
--RoKjell-- |
|
|
| Report Abuse |
|
|
RoKjell
|
  |
| Joined: 22 Nov 2012 |
| Total Posts: 1205 |
|
|
| 07 Sep 2015 09:42 AM |
And that part is fixed, look at this part now:
wait(1) key = script.Parent.Parent.Value script.Parent.Value = game.Players:FindFirstChild(key).TotalDrones.Value
--RoKjell-- |
|
|
| Report Abuse |
|
|