I made this lightning script but since it was local the part instances didnt show for others so i tried to make a function with in the function script this
local create = {911} function create.load(player) local Play = player.Name local Mouse = Play:GetMouse() local Light1 = Instance.new("Part") Light1.BrickColor = BrickColor.new("Light blue") Light1.TopSurface = "Smooth" Light1.Material = "Neon" Light1.Anchored = true Light1.CanCollide = false Light1.Size = Vector3.new(0.2,200,0.2) local C1 = Light1:Clone() C1.Parent = workspace C1.CFrame = Mouse.Hit * CFrame.new(0,0,0) Mouse.Target.Parent.Humanoid:TakeDamage(30) return create() end
i made it a local script for the mouse but it didnt work when i tried require in the main script that triggers the lightning keybind my whole script for the keybind was
local player = game.Players.LocalPlayer local character = player.Character local ammo = 1 game:GetService("UserInputService").InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.T then if ammo == 1 then script.Lightning:Play() local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://4577006839" local humanoid = character:WaitForChild("Humanoid") humanoid:LoadAnimation(animation):Play() require(911).load(Player.Name) ammo = 0 wait (2) ammo = 1 end end end)
Everything works but i dont understand why doesnt my require work i found this in a wiki before i thought it would work can ya help me?