Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

attempt to index number with 'Position'?

Asked by 4 years ago
Edited 4 years ago

I feel i am missing out on something and that im being dumb.

Can you fix this error? (On line 35) (Workspace.Crate Drops.Crate Drop.Handler:35: attempt to index number with 'Position')

01DB = false
02HitBox = script.Parent["Crate"].Hit
03local Remote = script.Parent.Regen
04local Workspace = game:GetService("Workspace")
05HitBox.CFrame = CFrame.new(math.random(-1024,1024),1000,math.random(-1024,1024))
06function Stuff(PRT)
07        if not DB then
08        local function SpawnItem(POS)
09            if math.random(1,2) ~= 1 then
10                Tier = 1
11            else
12                if math.random(1,4) ~= 1 then
13                    Tier = 2
14                else
15                    if math.random(1,8) ~= 1 then
View all 84 lines...

Thank you, Btw the script is made for a crate supply thingy.

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

The problem is "POS" is equal to 1, as stated on line 48. Assuming there is nothing else wrong with the script, removing the "1" parameter should work. If you planing on using the first parameter, then add a second argument on line 8.

Edited version.

01DB = false
02HitBox = script.Parent["Crate"].Hit
03local Remote = script.Parent.Regen
04local Workspace = game:GetService("Workspace")
05HitBox.CFrame = CFrame.new(math.random(-1024,1024),1000,math.random(-1024,1024))
06function Stuff(PRT)
07        if not DB then
08        local function SpawnItem(POS)
09            if math.random(1,2) ~= 1 then
10                Tier = 1
11            else
12                if math.random(1,4) ~= 1 then
13                    Tier = 2
14                else
15                    if math.random(1,8) ~= 1 then
View all 84 lines...
0
Yes hasanchik 49 — 4y
Ad

Answer this question