In my game, there is a sphere which is supposed to clone an object from workspace and place it within its position. The object depends on wether DbB is in the workspace or not The game says that object is not a valid member of sphere.~~~~~~~~~~~~~~~~~

while true do if game.Workspace.DbB and not script.Parent.TPEDO then if script.Parent.Coin then script.Parent.Coin:Destroy() end local c = game.ReplicatedStorage.TPEDO:Clone() c.Parent = script.Parent

end
if not game.Workspace.DbB and not script.Parent.Coin then
	if script.Parent.TPEDO then
		script.Parent.TPEDO:Destroy()
	end
	local c = game.ReplicatedStorage.Coin:Clone()
	c.Parent = script.Parent
	
end

end


2 comments

0

can you edit the post and fix the script so it's easier for us to read

0

Nevermind fixed it