I made a script that, spawns in a brick to your location, and tried to make it do damage; but for some reason the touch function isn't working at all. I sectioned the touch function, where im having the problem. it is sectioned "----Damage----"
replicatedstorage = game:GetService("ReplicatedStorage") tool = script.Parent.Parent.Parent Smite = replicatedstorage:FindFirstChild("RicoClass").Smite baseAtk = 32 debounce = true M = replicatedstorage:FindFirstChild("RicoClass").SmiteModel shockwave = replicatedstorage:FindFirstChild("RicoClass").Shockwave Smite.OnServerEvent:connect(function(player) local root = player.Character:FindFirstChild("HumanoidRootPart") local m = M:clone() local smiteM = m:GetChildren() local shockW = shockwave:clone() local dmg = math.floor(script.Parent:FindFirstChild("Charging").Value / 1.6 + baseAtk + 0.5) print(script.Parent:FindFirstChild("Charging").Value) wait() print("s") -------------------------------------------------------- for i, v in pairs(smiteM) do ---------------goes into smite model if v.Name == "Inner" then -------------finds a part named inner inside the model v.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) v.Parent = game.Workspace ----------------Damage------------------- v.Touched:connect(function(hit) ---------if a player touches the part called inner in the model take dmg, not working though if not debounce then return end debounce = false local dmg = math.floor(script.Parent:findFirstChild("Charging").Value / 1.6 + baseAtk + 0.5) local opponent = hit.Parent:findFirstChild("Humanoid") or hit.Parent.Parent:findFirstChild("Humanoid") if opponent and opponent ~= player.Character.Humanoid then opponent:TakeDamage(dmg) -----------------Text--------------------- local effect = Instance.new("BillboardGui", opponent.Parent.Head) effect.Size = UDim2.new(1,0,1,0) wait() local text = Instance.new("TextBox") text.Parent = effect text.TextSize = 60 text.TextColor3 = Color3.new(255,0,0) text.TextStrokeColor3 = Color3.new(170,0,0) text.Font = "Cartoon" text.BackgroundTransparency = 1 text.Size = UDim2.new(1,0,1,0) text.Text = dmg for i = 0,5 do wait(0.04) effect.StudsOffset = Vector3.new(0,i,0) end wait(0.2) effect:destroy() end wait(1) debounce = true end) for i = 0,2,0.2 do wait(0.01) v.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) v.Size = v.Size + Vector3.new(0,i,i) v.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) end wait() for i = v.Transparency,1,0.025 do wait(0.01) v.Transparency = i end wait() v:remove() wait(1) end end -------------------------------------------------------- wait(0.1) script.Parent:FindFirstChild("Charging").Value = 0 end) -------------------------------------------------------- ---------------------Outer------------------------------- replicatedstorage = game:GetService("ReplicatedStorage") tool = script.Parent.Parent.Parent Smite = replicatedstorage:FindFirstChild("RicoClass").Smite baseAtk = 32 debounce = true M = replicatedstorage:FindFirstChild("RicoClass").SmiteModel shockwave = replicatedstorage:FindFirstChild("RicoClass").Shockwave Smite.OnServerEvent:connect(function(player) local root = player.Character:FindFirstChild("HumanoidRootPart") local m = M:clone() local smiteM = m:GetChildren() local shockW = shockwave:clone() local dmg = math.floor(script.Parent:FindFirstChild("Charging").Value / 1.6 + baseAtk + 0.5) print(script.Parent:FindFirstChild("Charging").Value) wait() print("s") -------------------------------------------------------- for i, b in pairs(smiteM) do if b.Name == "Outer" then b.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) b.Parent = game.Workspace for i = 0,2,0.2 do wait(0.01) b.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) b.Size = b.Size + Vector3.new(0,i,i) b.CFrame = root.CFrame * CFrame.Angles(math.rad(0),math.rad(0),math.rad(90)) end wait() for i = b.Transparency,0.75,0.025 do wait(0.01) b.Transparency = i end wait() b:remove() end end -------------------------------------------------------- wait(0.1) script.Parent:FindFirstChild("Charging").Value = 0 end)