I tried to make a script that sets attribute to a player's character once the player joins. The script is:
print("bb") local players = game:GetService("Players") local player = players.LocalPlayer players.PlayerAdded:Connect(function() print("it works") local haki = player.Character:SetAttribute("Haki", false) end)
The first print works, but the second doesn't. That probably means the function never fires. There is no error/warning outputs at all either. The script is a local script and located in StarterPlayerScripts (I've also tried moving it to StarterCharacterScripts but that didn't work)
The event will not fire for the local player because the local player is loaded before the script loads; it will fire for future players that join.
Perhaps put the local script inside StarterCharacterScripts and set the attribute there; as the character is already loaded, you do not need an event.
local Character = script.Parent local haki = Character:SetAttribute("Haki", false)