I had my script working before, but one day it just stopped working, I have very bad memory issues and I can barely recall changing it

function onClicked()

local shipp = "Bullet"

local owner = script.Parent.Parent.Parent.Parent.Parent.owner.Value

if game.Players:FindFirstChild(owner).leaderstats.Rank.Value >= 5 and script.Parent.Parent.Parent.Parent.Parent.Ships:FindFirstChild(shipp) == nil then

if not script.Parent.Parent.Parent.Parent.Parent.Ships:GetChildren() then

local ship = game.Lighting.Ships.Bullet:Clone()

ship.Parent = script.Parent.Parent.Parent.Parent.Parent.Ships

ship:SetPrimaryPartCFrame(CFrame.new(script.Parent.Parent.Parent.Parent.Customize.Position))

elseif script.Parent.Parent.Parent.Parent.Parent.Ships:FindFirstChild(shipp) ~=nil then

script.Parent.Parent.Parent.ShipRespawnWarningBullet.Visible = true

elseif game.Players:FindFirstChild(owner).leaderstats.Rank.Value <= 5 then

print("ERROR: Incorrect Rank")

end

end

end

script.Parent.MouseButton1Down:connect(onClicked)

Here is also the error I get

Workspace.RedEmptyHanger.cps.SurfaceGui.Ships.Bullet.Script:11: attempt to compare number with boolean

This only happens if the value is correct

3 comments

0

Could this be because of FilteringEnabled?

0
  1. FilteringEnabled Doesn't Effect It, Tested
0
  1. I forgot to put this info, the error, 16:22:29.876 - Workspace.RedEmptyHanger.cps.SurfaceGui.Ships.Stinger.Script:11: attempt to compare number with boolean