I’m trying to make passives for my game and I’m encountering issues with adding the accessory, everything print’s up to print("obelisks grace is on")
, however it is, and it only adds the accessory and the effect when the player resets, here’s my script:
local obeliskadded = false
game.Players.PlayerAdded:Connect(function(plr)
print(plr.Name.." added")
plr.CharacterAdded:Connect(function(char)
print(char.Name.." char added")
local statfolder = plr:WaitForChild("StatFolder")
if statfolder then
print("statfolder found")
end
local passivemodels = game.ReplicatedStorage.Passives
if statfolder.Passive1.Value == "ObelisksGrace" or statfolder.Passive2.Value == "ObelisksGrace" or statfolder.Passive3.Value == "ObelisksGrace" then
print("obelisks grace is on")
wait(3)
print("obelisk adding")
repeat wait() until char:FindFirstChild("Humanoid")
print("humanoid found")
local humanoid = char.Humanoid
humanoid:AddAccessory(passivemodels.ObelisksGrace:Clone())
print("accessory added")
if obeliskadded == false then
statfolder.Strength.Value += 5
obeliskadded = true
end
end
end)
end)
If you can figure out why it’s now working, please tell me, that would be most appreciated.