Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this script not working?

Asked by 10 years ago

So the script is supposed to react to when a player gets a certain amount of a particular stat. However, the script doesn't perform anything at all. Output gave me nothing. Can someone please help me? Here's the script:

Player = script.Parent.Parent

while not Player:findFirstChild("leaderstats") do wait(1) end --loop wait until leaderstats load

while not Player.leaderstats:findFirstChild("Streak") do wait(1) end -- same for streak

Player.leaderstats.Streak.Changed:connect(function(v) --creating this connection line assigns the function inside of it to fire every time Streak changes its value; instead of just the one time.
if v == 15 then
game.Workspace.Text.Value = ""..Player.Name" is going all out with a 15 Killstreak!"
game.Workspace.YOLO:play()
wait(10)
game.Workspace.Text.Value = ""
end
end)

1 answer

Log in to vote
2
Answered by 10 years ago

You forgot to concatenate the string after Player.Name

0
Thank you very much, it works now. CoolJohnnyboy 121 — 10y
Ad

Answer this question