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

The developer Console says "index nil" for my script. How do I fix this?

Asked by 2 years ago

Script:


function make(pos) local g = Instance.new("Part") g.Parent = workspace g.BrickColor = BrickColor.new("Cork") g.Size = Vector3.new(4,4,4) g.CFrame = pos end script.Parent.Parent.Activated:Connect(function() local mouse = game.Players:GetPlayerFromCharacter(script.Parent.Parent.Parent):GetMouse() make(mouse.Hit) end)

The problem is that every time this script runs on line 11 it causes an index nil for some reason. How do I fix this?

0
this is a normal script not local btw snowpototoy 37 — 2y
0
Where is this script placed BeautifulAuraLover 371 — 2y
0
startergui snowpototoy 37 — 2y
0
I'd recommend using remote events for this. echobloxia 21 — 2y
0
god i learned how to use remote events and learned that hit is cframe snowpototoy 37 — 2y

Answer this question