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

Forcefield script has no errors but doesn't work properply. Why?

Asked by 3 years ago
Edited 3 years ago

It's supposed to put the sphere in replicated storage around you to work as a forcefield but it doesn't work at all. And all it has no errors so I'm very confused

serverscript:

local tweenservice = game:GetService("TweenService")

game.ReplicatedStorage.ActivateForceField.OnServerEvent:Connect(function(Player)
    local character = Player.Character
    local properties = {
    Size = Vector3.new(7.4,7.4,7.4)

    }
    local newForceField = game.ReplicatedStorage.ForceField:Clone()
    newForceField.Parent = game.Workspace
    newForceField.CFrame = character.HumanoidRootPart.Cframe

    local info = TweenInfo.new(1, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out)

    local defualtWalkSpeed = character.Humanoid.WalkSpeed
    local defualtJumpPower = character.Humanoid.JumpPower
    character.Humanoid.WalkSpeed = 0
    character.Humanoid.Health = math.huge
    character.Humanoid.JumpPower = 0
    local tween = tweenservice:Create(newForceField, info, properties)
    tween:Play()
    wait(4)

    local FadeProperties = {
        Transparency = 1
    }

    local fadeInfo = TweenInfo.new(1)

    local fadeTween = tweenservice:Create(newForceField,fadeInfo,FadeProperties)
    fadeTween:Play()
    wait(1)
    newForceField:Destroy()
    character.Humanoid.WalkSpeed = defualtWalkSpeed
    character.Humanoid.JumpPower = defualtJumpPower
end)

local script:

local uis = game:GetService("UserInputService")

uis.InputBegan:Connect(function(code)
    if code == Enum.KeyCode.E then
        game.ReplicatedStorage.ActivateForceField:FireServer()
    end
end)
0
what i meant by no errors is that nothing shows up in the output tab Funnyskyswagway3 30 — 3y

Answer this question