My part that i am cloning multiple times has SelectionBox object and this script in it:
box = script.Parent.SelectionBox while true do wait(0) box.Adornee = script.Parent wait(0.5) end
And under StarterGui i have LocalScript:
wait(1) Player = game.Players.LocalPlayer Mouse = Player:GetMouse() local Part = game.Workspace.clonedparts.kockastone -- this is where i store new cloned parts while true do if Mouse.Target == Part then Mouse.Target.SelectionBox.Visible = true else Part.SelectionBox.Visible = false end wait(0) end
I found the problem. As it turns out you crash the script if you call out
Part = game.Workspace.clonedparts.kockastone
multiple times, so i changed things and used
Part = script.Parent
instead.
Thx for all your help!