https://gyazo.com/aa77efeae669f9139d1fa7fa4f2ef3fa
local raidvalues = game.ReplicatedStorage.RaidValues
while true do
wait(1)
if raidvalues.Value == true then
if raidvalues.RaidType.Value == "Domination" then
if raidvalues.DefenderPoints.Value >= 3000 then
GlobalNotify("Defenders win!")
raidvalues.Value = false
game.ReplicatedStorage.EndingRaid:FireAllClients()
end
if raidvalues.RaiderPoints.Value >= 100 then
GlobalNotify("Raiders win!")
raidvalues.Value = false
game.ReplicatedStorage.EndingRaid:FireAllClients()
end
end
end
end
function GlobalNotify(Notification)
game.ReplicatedStorage.RaidNotifications:FireAllClients(Notification)
end
All of my values are correct, its just the function does not work.

1 comment
Lava_Scripter provided the correct code, but didn't tell you why he modified it in the way he did. A script runs from top to bottom. If a script is in a while loop forever, it won't reach the lines that are underneath it, because it's repeating what's in the while loop over and over, and will never continue on with the script beyond the while loop. You have to define a function before you call it.