Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My Barrier doesnt shoot forward???

Asked by 6 years ago
Edited 6 years ago

I added velocity and lookvector but its still not workinig. Help. Here is the local script:

local Tool = script.Parent
Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
char = Player.Character
hum = char.Humanoid 
root = char.HumanoidRootPart
local UIS = game:GetService("UserInputService")
local RemoteEvent = Tool.RemoteEvent

local en = true
Tool.Activated:connect(function()
 if not en then return end
 en = false
wait(.5)
en = true
end)


local Debounce = false

UIS.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.Q then
    if Debounce == true then return end
    RemoteEvent:FireServer(Debounce)
end








end)

Here is the Script:

    local Tool = script.Parent

Tool.RemoteEvent.OnServerEvent:Connect(function(Player, Debounce)
local Character = Player.Character
Debounce = true
local Barrier = Instance.new("Part")
Barrier.BrickColor = BrickColor.new("Lime green")
Barrier.Material = "Neon"
Barrier.Transparency = 0.25
Barrier.FormFactor = "Custom"
Barrier.Anchored = true
Barrier.Size = Vector3.new(1,9,6)
Barrier.Shape = Enum.PartType.Block
Barrier.Locked = true
Barrier.CanCollide = false
Barrier.CFrame = Tool.Handle.CFrame
Barrier.Parent = Character
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
 bv.Velocity = Character.HumanoidRootPart.CFrame.lookVector * 50
 bv.Parent = Barrier




wait(2)
Debounce = false











end)
0
uhh explain more pls and FormFactor is decaperated i believe User#23365 30 — 6y
0
also i dont think you can transfer a debounce through the parameters in :FireServer(), correct me if im wrong User#23365 30 — 6y
0
yes you can User#19524 175 — 6y
0
the variable itself wouldn't be sent but its value User#19524 175 — 6y
View all comments (3 more)
0
k User#23365 30 — 6y
0
so what is wrong with the script?? SplendidKyle567 8 — 6y
0
CAUSE IT IS ANCHOREDDDDDDDDDDDDDD SplendidKyle567 8 — 6y

Answer this question