So im making a system for a game with rounds that u need to collect gems every round, but this script isnt working and idk why, it shows no errors at output
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local Gems = game.Workspace.Gems:GetChildren()
ServerScriptService.TimeHandler.Disabled = true
while true do
Gems.Transparency = 1
Gems.CanTouch = false
ReplicatedStorage.Values.Time.Value = 180
ServerScriptService.TimerHandler.Disabled = true
wait(30)
end
If it’s a LocalScript, make sure it’s not under workspace, or any other Service where LocalScripts don’t work.
Try to place prints in your script, see where it reaches, and where it stops.
i didnt even need, i could find that bc in a line after the part that makes the gem disappears got an error so its working fine
Gems is a table of the contents from Workspace.Gems so you have to change each one in a loop:
for _,v in ipairs(Gems) do
v.Transparency = 1
v.CanTouch = false
end
3 Likes
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local Gems = game.Workspace.Gems:GetChildren()
ServerScriptService.TimeHandler.Disabled = true
for i, Gem in pairs(Gems) do
Gem.Transparency = 1
Gem.CanTouch = false
end
ReplicatedStorage.Values.Time.Value = 180
ServerScriptService.TimerHandler.Disabled = true
task.wait(30)