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)

2 comments

0

Where is the folder?

0

Well, if it says attempt to index nil, the folder is nil (Nothing)