Why I kept receiving this error message? And why the value not changing?
Error Message: 22:25:59.225 - Workspace.Events.Combat System.Movements.Power.current:9: attempt to index nil with 'Value'
local event = game.ReplicatedStorage.GameEvents.Combat.Activate event.current.OnServerEvent:Connect(function(player) local c = player:findFirstChild("current") local main = player.PlayerGui.Stuff.Combat.current local char = player.Character c.Value = main.Value print(c.Value") end)
First, let's fix the indentation and replace "findFirstChild" with "FindFirstChild"(because the former is deprecated, I think):
local event = game.ReplicatedStorage.GameEvents.Combat.Activate event.current.OnServerEvent:Connect(function(player) local c = player:FindFirstChild("current") local main = player.PlayerGui.Stuff.Combat.current local char = player.Character c.Value = main.Value print(c.Value") end)
And the only issue I really see is that you did this:
print(c.Value")
It should be this:
print(c.Value)