The script i’m talking about located in the workspace, that’s it. ( sorry for bad grammar )
Thanks, now I know what to do, because if it was located in the boss then It would be something else. let me see how this will work out
while wait() will be located at line 15 or somewhere else?
line 15 aka where you put wait(sound.length)
local humanoid = game.Workspace.Boss:FindFirstChild(“Humanoid”)
local cash = 100
local leaderstats = game.ServerScriptService.leaderstats
local sound = game.Workspace.cashregistersound
local debounce = false
local boss = game.Workspace.Boss
while wait() do
if debounce == false then
humanoid.Died:Connect(function()
if humanoid.Health == 0 then -- you dont really need this because getting .died means that the player/boss has died
debounce = true
for i, players in pairs(game.Players:GetPlayers()) do
players.leaderstats.Points.Value += cash
end
wait(2) -- I would recommend deleting this but you dont have to
sound.Playing = true
wait(sound.length) -- Instead of .length change it to the original wait time
sound.Playing = false
debounce = false
end -- if you end up deleting if humanoid.Health == 0 then just delete this end
end)
end
end
I dont know if this script works the way you want it to, but I think it should
Tested this, after I killed the boss, points reward value is randomly counted aka I received 28000 instead of 100.
common error. let me fix that, sorry about that
wait a question, does the boss respawn or not?
Yes, It does since I’m testing boss if the script will continue to work or it will end up working only at the one time.
Good idea, why not put this script in the Boss model that gets respawned already.
That would work better, then the script would also respawn with the boss
Thanks for telling me guys. I would try this.
also you can get rid of the while wait do, (and one of the ends) because it will just keep on repeating it
I would use this script instead of the while wait function one.
Edit: It does same thing, script still work only at one time.
have you killed the boss multiple times? or just once?
I killed the boss multiple times, only one time still work, rest of it doesn’t.
wait so is the script in the boss?
Yep, just put the script into the boss model, doesn’t fix anything.
can you send a picture of the inside of the boss? and where the boss is located?