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

ServerScriptService.RemoteHandler:5: attempt to index nil with 'Power'?

Asked by
Zelt3q 31
3 years ago

I have a problem. When I simply put my tool in the StarterPack from the start it works fine. However, when I put it in a folder, and clone it and attach it to game.Players.LocalPlayer.Backpack it retrieves ServerScriptService.RemoteHandler:5: attempt to index nil with 'Power'. Any ideas why?

Add Power script:

local sword = script.Parent
local player = game.Players.LocalPlayer

sword.Activated:Connect(function()
    if player.Debounce.Value == false then
        game.ReplicatedStorage.RemoteEvents.Power:FireServer(script.Parent.Values)

        local action = script.Parent.Parent.Humanoid:LoadAnimation(script.Animation)

        action:play()
    end
end)

Remotehandler script

ReplicatedStorage.RemoteEvents.Power.OnServerEvent:Connect(function(player, valueFolder)
    if player.Debounce.Value == false then
        player.leaderstats.Power.Value = player.leaderstats.Power.Value + valueFolder.Power.Value*(player.leaderstats.Rebirths.Value + 1)
        player.Debounce.Value = true
        wait(valueFolder.Cooldown.Value)
        player.Debounce.Value = false
    end
end)
0
Where is the folder? Optikk 499 — 3y
0
Well, if it says attempt to index nil, the folder is nil (Nothing) sebanuevo 123 — 3y

Answer this question