This script essentially generates an orb, and shoots in out where your mouse cursor is, it will then blow up. Everything is working well, except for the explosion. It wont appear.
I have absolutely NO clue as to why its
game.ReplicatedStorage.Moves.OnServerEvent:Connect(function(plr,mousehit,key) if key == "Shakkahou" then local char = plr.Character local hum = char.Humanoid local root = char.HumanoidRootPart local charging = Instance.new("Part") charging.Size = Vector3.new(1,1,1) charging.Transparency = 0.5 charging.CanCollide = false charging.BrickColor = BrickColor.new("Really red") charging.Shape = Enum.PartType.Ball charging.Material = Enum.Material.Neon charging.Parent = workspace local weld = Instance.new("Weld") charging.CFrame = root.CFrame * CFrame.new(0,1.3,-2) weld.Part0 = root weld.Part1 = charging weld.C0 = root.CFrame:Inverse() weld.C1 = charging.CFrame:Inverse() weld.Parent = charging wait(1) weld:Destroy() local bv = Instance.new("BodyVelocity") bv.Parent = charging bv.MaxForce = Vector3.new(1e8,1e8,1e8) bv.Velocity = mousehit.lookVector*50 game.Debris:AddItem(charging,5) local debounce = false charging.Touched:Connect(function(hit) if debounce == false then debounce = true local ehum = hit.Parent:FindFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") if ehum and ehum ~= hum then ehum:TakeDamage(10) end local explosion = Instance.new("Part",workspace) explosion.Size = Vector3.new(1,1,1) explosion.Transparency = 0.5 explosion.CanCollide = false explosion.Name = "Explosion" explosion.BrickColor = BrickColor.new("Really red") explosion.Shape = Enum.PartType.Ball explosion.Material = Enum.Material.Neon explosion.Position = CFrame.new(charging.CFrame.x,mousehit.y,charging.CFrame.z) local tween = game:GetService("TweenService") local tweeninfo = TweenInfo.new(2,Enum.EasingStyle.Quint,Enum.EasingDirection.In,0,false,0) local tweenproperties = {Size = Vector3.new(50,50,50)} tween:Create(explosion,tweeninfo,tweenproperties) wait(2) local tweeninfo2 = TweenInfo.new(1,Enum.EasingStyle.Quint,Enum.EasingDirection.In,0,false,0) local tweenproperties2 = {Transparency = 1,Size = Vector3.new(40,40,40)} tween:Create(explosion,tweeninfo2,tweenproperties2) wait(1) explosion:Destroy() wait(5) debounce = false end end) end end)
First of all you didn't actually play the tweens, however reading the comments suggests that it didn't work anyways. The most logical reason I have for is that you didn't parent the explosion to anything. Here is what it should look like (Not saying you don't know how to parent just in case you didn't understand me):
local explosion = Instance.new("Part",workspace) explosion.Size = Vector3.new(1,1,1) explosion.Transparency = 0.5 explosion.CanCollide = false explosion.Name = "Explosion" explosion.BrickColor = BrickColor.new("Really red") explosion.Shape = Enum.PartType.Ball explosion.Material = Enum.Material.Neon explosion.Position = CFrame.new(charging.CFrame.x,mousehit.y,charging.CFrame.z) --And The Parent explosion.Parent = charging --OR Wherever it should be parented.
REMEMBER TOO play the tweens so everything works fine. Just a reminder to keep your script working :)
This appears to be an issue on roblox's end. I've had the same issue. Check if your explosion spawns in the center of the map (0,0,0).