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

Cant make selection box work on Cloned parts, help?

Asked by
CIG0 -5
5 years ago
Edited 5 years ago

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

0
Are they all named "part"? Thepoint13 99 — 5y
0
no they are named kockastone , like the original one CIG0 -5 — 5y
0
Are you cloning the part on the client or the server? MrMedian 160 — 5y
0
Server i think, its all going into the Workspace CIG0 -5 — 5y

1 answer

Log in to vote
0
Answered by
CIG0 -5
5 years ago

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!

Ad

Answer this question