Hi, thanks for clicking on my question :) I really appreciate it.
I'm trying to make a GUI where you click a button (I already got that down) and it clones a Box from game.Lighting and puts it in the Player's character. I want the button to remove an already existing Box that the Player owns and spawn a new one right in front of the Player.
It's my weird way of trying to script because I don't remember half of the stuff I used to know how to do, LOL.
Can someone write me a new script or revise the one I have now for it to do what I want it to?
Here's what I have so far:
function onButtonClicked()
if script.Parent.Parent.Parent.Parent.Character.Box ~= nil then
script.Parent.Parent.Parent.Parent.Character.Box:remove()
elseif script.Parent.Parent.Parent.Parent.Character.Box == nil then
game.Lighting.Box:Clone()
game.Lighting.Box.Parent = script.Parent.Parent.Parent.Parent.Character
wait()
script.Parent.Parent.Parent.Parent.Character.Box.Torso.CFrame = CFrame.new(script.Parent.Parent.Parent.Parent.Character.Head.Position + Vector3.new(0, -5, -5))
end
end
script.Parent.MouseButton1Click:connect(onButtonClicked)

1 comment
JESUS IS LORD AND HE LOVES YOU!!! :D