Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

[SOLVED BY ME] Why isn't my BoolValue apearing in the character?

So recently, I had a problem of the killfeed template cloning 4 times instead of once. My solution was to make a BoolValue inside of the player's character and name it "IsAlive". I would then detect the change of the BoolValue using .Changed

However, When I playtested my game with my friends, the BoolValue never actually appeared!

Here's the server script:

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local isAlive = game.ReplicatedStorage.IsAlive:Clone()
		isAlive.Parent = char
	end)
end)

Why isn't this working? Am I doing something wrong? There are no errors in the output other than the WaitForChild yields because the bool value doesn't exist, yada yada yada...

Please help!

2 comments

0

um i can help you

0

Oh. Okay. What's the problem? @xXCoolTurkXx

2 answers

✓ Accepted answer

Hello. Instead of cloning the BoolValue, try making one with Instance.new. Try this:

game:GetService("Players").PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		local isAlive = Instance.new("BoolValue")
		isAlive.Name = "IsAlive"
		isAlive.Parent = char
	end)
end)

I also used :GetService() since it checks if the service is existent. If it isn't it creates the service. Please upvote and accept this answer if it helps.

1 comment

0

Thank you! I already solved my problem by simply adding the values into the starter character. Thanks for helping though!

game.Players.PlayerAdded:Connect ..
..
local isAlive = Instance.new("Boolvalue",plr)

2 comments

0

Nope. Doesn't work.

0

uh

This discussion is preserved as it was. New answers, comments, and votes are closed.