This is a problem I’ve been having for the last couple of days. If ‘CharacterAdded:Wait()’ is in the script, even if the character is already loaded in, it continues to yield. There are no errors what so ever. An example would be this local script:
local player = game.Players.LocalPlayer
print(player)
player.CharacterAdded:Wait()
print(player.." 2")
--local event = game.ReplicatedStorage.RemoteEvent
--print(event)
while true do
wait(0.5)
print("i-")
workspace["part 1"].Position = Vector3.new(math.random(-999, 999), 500, math.random(-999, 999))
workspace["part 2"].Position = Vector3.new(math.random(-999, 999), 500, math.random(-999, 999))
local LightningBolt = require(game.ReplicatedStorage.LightningBolt)
local LightningSparks = require(game.ReplicatedStorage.LightningBolt.LightningSparks)
--Create a new bolt with 40 parts
local NewBolt = LightningBolt.new(workspace["part 1"].Attachment, workspace["part 2"].Attachment, 40)
--Then, update properties to your liking
NewBolt.CurveSize0, NewBolt.CurveSize1 = 10, 15
NewBolt.PulseSpeed = 2
NewBolt.PulseLength = 0.5
NewBolt.FadeLength = 0.25
NewBolt.MaxRadius = 1
NewBolt.Color = Color3.new(math.random(), math.random(), math.random())
local NewSparks = LightningSparks.new(NewBolt)
end
I know that it continues to yield because, in the output, it doesn’t print my ‘O_Ogosh1 2’, which is what I told it to do after the character was loaded.
I have already looked in the developer Hub, but haven’t found anything that pertains to this, if you have a solution or saw a post that had a similar problem please do tell.