script.Parent.Humanoid.Died:Connect(function() if game.Players.LocalPlayer.PlayerGui.Quest.After.Visible == true then game.StarterPlayer.clevel.Value = game.StarterPlayer.clevel.Value + 1 end end)
i made when npc died and frame visible then the int value + 1
This is the script this is a local script there is no errors
clevel is the int value after is the frame
but not works
Make sure you've put your script in one of these:
A Player’s Backpack, such as a child of a Tool A Player’s character model A Player’s PlayerGui A Player’s PlayerScripts. The ReplicatedFirst service
while true do wait (1) script.Parent.Humanoid.Died:Connect(function() if game.Players.LocalPlayer.PlayerGui.Quest.After.Visible == true then game.StarterPlayer.clevel.Value = game.StarterPlayer.clevel.Value + 1 end end)
Try this.
okValue = nil if game.StarterPlayer.clevel.Value > 1 and game.StarterPlayer.clevel.Value ~= okValue then okValue = game.StarterPlayer.clevel.Value game.StarterPlayer.clevel.Value = 1 end local Killing = false while true do wait (1) script.Parent.Humanoid.Died:Connect(function() Killing = true if game.Players.LocalPlayer.PlayerGui.Quest.After.Visible == true and game.StarterPlayer.clevel.Value = okValue then game.StarterPlayer.clevel.Value = game.StarterPlayer.clevel.Value + 1 Killing = false end end)
If it doesn't work tell me, I'll edit it.