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

why does my FE compatible ForceFieldGui script work in studio, but doesnt work online in roblox?

Asked by 5 years ago

Im learning about FE, so i made this FE Forcefield gui, so when you click it you get a forcefield, but your WalkSpeed and JumpPower lower for 10 seconds. It works in studio, but not online, can anyone find the problem?

local script:

script.Parent.MouseButton1Click:Connect(function()
    game.ReplicatedStorage.Remote:FireServer("ForceField")
end)

serverscript:

debounce = false

game.ReplicatedStorage.Remote.OnServerEvent:Connect(function(player, FF)
    if debounce then return end
    debounce = true
    if FF == "ForceField" then
        local player = game.Players.LocalPlayer
        FF = Instance.new("ForceField")
        local sparkles = Instance.new("Sparkles")
        sparkles.SparkleColor = Color3.fromRGB(255, 255, 255)
        sparkles.Parent = player.Character.HumanoidRootPart
        player.Character.Humanoid.WalkSpeed = 12.5
        player.Character.Humanoid.JumpPower = 40
        FF.Parent = player.Character
        wait(10)
        FF:Remove()
        sparkles:Remove()
        player.Character.Humanoid.WalkSpeed = 16
        player.Character.Humanoid.JumpPower = 50
        debounce = false
    end
end)

I used a RemoteEvent.

0
Put the RemoteEvent in ReplicatedFirst and use WaitForChild just in case (define it as a variable) TiredMelon 405 — 5y
0
ok User#23365 30 — 5y
0
still doesnt work User#23365 30 — 5y
0
Just a side note, your debounce will make it so only player can get a forcefield at a time, what you have to do is store a table of players that are 'debounced' if you wanted multiple players to have a forcefield. climethestair 1663 — 5y
0
how do u do that User#23365 30 — 5y

Answer this question