You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Change a NumberValue in ReplicatedStorage from a Server Script.
-
What is the issue? When changing the value with the script below, The script prints the correct value, but when playtesting, as both the Client and Server, the value doesnt actually change. Im not sure how its getting the value that its printing if the value isnt changing.
local events = {
"Speed",
"Big Head",
"Slow"
}
local rs = game:GetService("ReplicatedStorage")
local cooldown = rs:WaitForChild("Cooldown").Value
while true do
if cooldown == 0 then
local random = math.random(1, #events)
local event = events[random]
game.ReplicatedStorage.Event.Value = event
if event == "Speed" then
print("Speed")
elseif event == "Big Head" then
print("Big Head")
elseif event == "Slow" then
print("Slow")
end
cooldown = 10
print(cooldown)
elseif cooldown <= 10 then
wait(1)
cooldown -= 1
print(cooldown)
end
end
(Edit: I tried using an IntValue too, which did not change anything. The Event value mentioned in the script above does change. But the cooldown value does not.)