Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i make a invisible tool that only becomes visible when you click it?

Basically i have a fireball and i only want it to be visible whenever i click it and it fires.

So i have a server script and i have a local script

Local script here.

--Local Script
local Tool = script.Parent
play = game.Players.LocalPlayer
local mouse = play:GetMouse()
repeat wait() until play.Character
char = play.Character
hum = char.Humanoid
root = char.HumanoidRootPart



local en = true
Tool.Activated:connect(function()
 if not en then return end
 en = false
 Tool.RemoteEvent:FireServer(mouse.Hit)
 wait(5)
 en = true
end)

Script here

--Server Script
local Tool = script.Parent
play = Tool.Parent.Parent 
char = play.Character
hum = char.Humanoid 
root = char.HumanoidRootPart

local en = true


Tool.RemoteEvent.OnServerEvent:connect(function(play,mousehit)
 local a = hum:LoadAnimation(Tool.Throw)
 a:Play()
 root.CFrame = CFrame.new(root.Position,root.Position + Vector3.new(mousehit.lookVector.x,0,mousehit.lookVector.z))
 wait(0.1)
 local fireball = Tool.Handle:clone()
 fireball.CFrame = Tool.Handle.CFrame
 local bv = Instance.new("BodyVelocity")
 bv.MaxForce = Vector3.new(1e8,1e8,1e8)
 bv.Velocity = mousehit.lookVector * 50
 bv.Parent = fireball
 fireball.CanCollide = false
 fireball.Parent = game.Workspace
 game.Debris:AddItem(fireball,4)
 local ten = true
 fireball.Touched:connect(function(hit)
 if not ten then return end
 ten = false
 local ehum = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid")
 if ehum and ehum ~= hum then
  ehum:TakeDamage(10)
 elseif hit.Anchored  == true and hit.CanCollide == true then
  for i=1,10 do
   local part = fireball:clone()
   part.Size = Vector3.new(0.5,0.5,0.5)
   part.CFrame = fireball.CFrame
   --part.BodyVelcoity.MaxForce = Vector3.new(1e8,0,1e8)
   part.ParticleEmitter.LockedToPart = false
   part.BodyVelocity.Velocity = Vector3.new(math.random(-30,30),math.random(-30,30),math.random(-30,30))
   part.Parent = game.Workspace
   game.Debris:AddItem(part,1)
  end
 end
 wait()
 ten = true
 end)
end)

2 comments

0

can u post the script?

0

k

1 answer

✓ Accepted answer

On line 3 of the script, you can add

Tool.Handle.Transparency = 1

to make the tool invisible, and on line 23 you can add

fireball.Transparency = 0

to make it visible when shot.

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.