Axyanz
(Axyanz)
#1
For some reason when I click the button it gives me this error:

Heres the script:
script.Parent.MouseButton1Click:Connect(function()
local killbrick = script.Parent.Parent.Parent.Parent.Parent.ScriptModels.Killbrick
killbrick:Clone()
killbrick.Parent = workspace
killbrick.Anchored = true
end)
Can you please send us a picture of the explorer
Maybe try removing one of the .Parent things
Why did you use .parent 5 times?
Axyanz
(Axyanz)
#6
because its outside the folder
Axyanz
(Axyanz)
#7
i tried using game.StarterGui.AdvancedScripts.ScriptModels.Killbrick but same error
Try replacing
local killbrick = script.Parent.Parent.Parent.Parent.Parent.ScriptModels.Killbrick
with
local killbrick = game.Workspace.Killbrick
Axyanz
(Axyanz)
#9
but the killbrick is in the folder?
Did you try it? ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤ
Axyanz
(Axyanz)
#11
it wont make sense since im cloning the brick and its not even in workspace but ill try it.
Axyanz
(Axyanz)
#12
sorry my old picture was wrong
heres where it is:
You failed to ever mention that your model was in StarterGui…
Do local killbrick = game.StarterGui.Killbrick
Axyanz
(Axyanz)
#14
I made it spawn in by making the script in the button but instead of cloning it its moving it?
local killbrickGui = script.Parent
local killbrick = game.StarterGui.AdvancedScripts.Killbrick
killbrickGui.MouseButton1Click:Connect(function()
print("Clicked")
killbrick.Parent = game.Workspace
killbrick:Clone()
killbrick.Anchored = true
print("Spawned")
end)
local killbrickGui = script.Parent
local killbrick = game.StarterGui.AdvancedScripts.Killbrick
killbrickGui.MouseButton1Click:Connect(function()
print("Clicked")
local KillBrick = killbrick:Clone()
KillBrick.Parent = game.Workspace
KillBrick.Anchored = true
print("Spawned")
end)