What the title says. I saw it in a scripting tutorial but I’m not quite sure what it means or does.
What tutorial did you use? You need to provide more information.
1 Like
Sorry, this fireball tutorial Ill post the Code in question.
local Fireball = game.ServerStorage:WaitForChild("FireBall")
game.ReplicatedStorage.Fireball.OnServerEvent:Connect(function(Player)
local Character = Player.Character
local NewFireball = Fireball:Clone()
NewFireball.CFrame = Character.HumanoidRootPart.CFrame
local BodyVelocity = Instance.new("BodyVelocity")
BodyVelocity.MaxForce = Vector3.new(5000, 5000, 5000)
BodyVelocity.Velocity = (Character.HumanoidRootPart.CFrame.LookVector*250)
BodyVelocity.Parent = NewFireball
NewFireball.Parent = workspace
local TouchConn
TouchConn = NewFireball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name ~= Player.Name then
hit.Parent:BreakJoints()
if TouchConn ~= nil then TouchConn:Disconnect() end
NewFireball:Destroy()
end
end
end)
wait(3)
if TouchConn ~= nil then TouchConn:Disconnect() end
NewFireball:Destroy()
end)
it works, just wondering what TouchConn is and w/e
TouchConn is just a variable, you mean the connection.
When connecting to a variable and disconnecting it, it means, the touched events gets ‘destroyed’ or not longer will work.
Disconnecting is good for memory puporses aswell, as not disconnecting events might cause memory leaks.
1 Like
Ohh thanks silly of me to not realize lol.