RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"make a lazer beam pop out of the players eyes when they click X on their keyboard"
-- local script local player = game.Players.LocalPlayer local mouse = player:GetMouse() local beam = Instance.new("Part", workspace) beam.BrickColor = BrickColor.new("Bright red") beam.FormFactor = "Custom" beam.Material = "Neon" beam.Transparency = 0.25 beam.Anchored = true beam.Locked = true beam.CanCollide = false mouse.KeyDown:Connect(function(key) if key == "x" then local position = mouse.Hit.p local distance = (player.Character.Head.CFrame.p - position).magnitude beam.Size = Vector3.new(0.3, 0.3, distance) beam.CFrame = CFrame.new(player.Character.Head.CFrame.p, position) * CFrame.new(0, 0, -distance / 2) end end)