Firstly: prepare yourself for some horrendous scripting that may seriously make you cry, I am quite new. This script is basically meant to make a box (target box) then move the smoke to the target destination. When you press Q, in a tool.
local tool = script.Parent
local spawned = false
game.Players.LocalPlayer:GetMouse().KeyDown:connect(function(key)
if string.lower(key) == "q" then
if player.script.Parent.Parent.Parent.Parent.Parent.leaderstats.Lvl.Value>=2 and player.script.Parent.Parent.Mana.Value>=20 then
if spawned then return end
local target = mouse.Target
local a = game.Lighting.union:Clone()
a.Parent = Workspace
a.Size = Vector3.new(3,3,3)
a.Anchored = true
a.CanCollide = False
spawned = true
while spawned do
wait()
a.CFrame = CFrame.new(Vector3.new(tool.Parent.Humanoid.TargetPoint.X,0,tool.Parent.Humanoid.TargetPoint.Z))
end
end
end)
function onButton1Down(mouse)
game.Workspace.Union.BrickColor = BrickColor.new(29)
a.Anchored=False --So it can't move (I think)
local smoke=game.lighting.Smoke:clone()
smoke.parent=Workspace
game.Workspace.smoke.CFrame = game.Workspace.union.CFrame+ Vector3.new(0, 4, 0)
wait (5)
a:remove()
smoke:remove()
function onEquipped(mouse)
function onEquipped(mouse)
mouse.Button1Down:connect(function () onButton1Down(mouse) end)
end
tool.Equipped:connect(onEquipped)
I probably missed a LOT of ends and I must apologies for my incompetence. Thank you in advance. Please bear with me in your explanations. Just so you know, I have been helped with a script that has inserted two IntValues into the player called Mana, and MAXMana, for your reference it can be found here: https://scriptinghelpers.org/questions/10533/help-on-this-script-with-intvalues

2 comments
Where do you set a local called grime? Look at this wiki page: http://wiki.roblox.com/index.php?title=BrickColor
Edited, thanks :D