For example if you get 10 kills I want it to execute the script
local Players = game:GetService("Players") function onPlayerAdded(player) kills = player.leaderstats.[Stat's name here, no brackets] if kills == 10 then [Remove this part and these brackets and insert your script here] end
Next time your asking for something.
EXPLAIN YOURSELF.
Not just a simple "i wunt dut wun i hav 10 keels a scrept hoopans"
No, you need to say stuff like.
"I want that when my leaderstat value "kills" gets into a certain value, a script gets triggered, There is the script i want to get triggered:"
INSERT YOUR FLIPPING SCRIPT HERE.
_G.char = game.Players.LocalPlayer.Character game.Players.PlayerAdded:Connect(function() local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Parent = char.Backpack local kills = Instance.new("IntValue") kills.Name = "Kills" kills.Parent = stats kills.Value = 0 end) if char.Backpack:FindFirstChild("Kills") ~= nil then k = char.Backpack:FindFirstChild("Kills") if k.Value >= 10 then if game.Workspace.TriggerScript.Disabled ~= false then -- What could be the script that fires game.Workspace.TriggerScript.Disabled = false end end end
Is this what you're talking about?