Sorry for the rough scripts, im fairly new, but what im trying to do is make a cylinder shaped object start in front of you and quickly expand outwards. my problem is that i cant figure out how to get it to go in front of you, and its always going across 1 of the axis.
Code for the local script that triggers the attack
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local UserInputService = game:GetService("UserInputService")
local plr = game.Players.LocalPlayer
local Char = plr.Character or plr.CharacterAdded:Wait()
local Remote = ReplicatedStorage.Fired
local Mouse = plr:GetMouse()
local Debounce = true
local Key = 'R'
UserInputService.InputBegan:Connect(function(Input, IsTyping)
if IsTyping then return end
local KeyPressed = Input.KeyCode
if KeyPressed == Enum.KeyCode[Key] and Debounce and Char then
Debounce = false
Remote:FireServer(Mouse.Hit)
wait(1)
Debounce = true
end
end)
Code for the attack itself
game.ReplicatedStorage.Fired.OnServerEvent:Connect(function(Player, Debounce)
local Character = Player.Character or Player.CharacterAdded:wait()
Debounce = true
local LightBeam = Instance.new("Part")
LightBeam.Name = "LightBeam"
LightBeam.Size = Vector3.new(3,3,3)
LightBeam.Shape = Enum.PartType.Cylinder
LightBeam.Material = Enum.Material.Neon
LightBeam.BrickColor = BrickColor.new("Cool yellow")
LightBeam.CanCollide = false
LightBeam.Parent = Character
LightBeam.CFrame = Character.Torso.CFrame*CFrame.new(0,1,0)
LightBeam.Anchored = true
wait(.2)
LightBeam.Size = Vector3.new(104,3,104)
wait(2)
LightBeam:Destroy()
end)
the game is set up to only use r6 models btw

1 comment
in line 12 use this code