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

I keep getting the error "bad cast". what is causing it and how do i fix it?

Asked by 5 years ago
Edited 5 years ago

I'm not too familiar to the new Lua works of Roblox and I couldn't find out anything about it on content help. this is the script segment that gives me the error:

local   trail = Instance.new("Trail", sun)
    trail.Color = ColorSequence.new(BrickColor.new("Royal purple").Color, BrickColor.new("Toothpaste").Color)
    trail.Attachment0 = sun

I just need to know how to fix it because this isn't the first time this has happened. every time I click the tool the error shows and I don't know how to fix it

0
Which line is it? Is the 'sun' variable a part? awesomeipod 607 — 5y
0
is sun actually an attachment? Vulkarin 581 — 5y

Answer this question