i tried another way to make weapons with fe on and i cant believe i cant do it. works in studio but not game and i tried multiple ways of waiting for the child so it loads in.
player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent.Parent enabled = true tool.Activated:connect(function() game.ReplicatedStorage.DamageEvent:FireServer()
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~ ``
`player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent enabled = true game.ReplicatedStorage.DamageEvent.OnServerEvent:connect(function() if enabled == true then local part = Instance.new("Part",game.Workspace) game.Debris:AddItem(part,3) part.Size = Vector3.new(0.1,0.1,3) part.Material = Enum.Material.Neon
part.TopSurface = "Smooth" part.BottomSurface = "Smooth" part.BrickColor = BrickColor.new("Gold") part.CanCollide = false part.CFrame = tool.Handle.CFrame part.CFrame = CFrame.new(part.Position,mouse.Hit.p) local v = Instance.new("BodyVelocity",part) v.Velocity = part.CFrame.lookVector * 500 v.maxForce = Vector3.new(math.huge, math.huge, math.huge) tool.Handle.Sound:Play() part.Touched:connect(function(hit) humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid and humanoid ~= game.Players.LocalPlayer.Character.Humanoid then humanoid.Health = humanoid.Health - 10 end end) enabled = false wait(0.5) enabled = true end
and if it looks weird idk how to fix im very new to site have not used it often
player = game.Players.LocalPlayer mouse = player:GetMouse() tool = script.Parent
cannot be in normal script