Hello, so I have been working on a minigame type game and I’m trying to make a script for something but in a line I want it to wait a number’s value in replicatedstorage but I keep on getting this error:
index function with ‘Value’
Here is my script:
wait(game.ReplicatedStorage.Remove.Value) -- remove is a number value
Thanks!
Edit: I also tried doing: wait(game.ReplicatedStorage.Remove)
Just looked into it, and Instance.remove is also used as a function for removing an object. So you should change the name of the value from “Remove” to something else.
game.ReplicatedStorage.TimeLeft.OnClientEvent:Connect(function(c)
script.Parent.Visible = true
for i = game.ReplicatedStorage.Time.Value,0,-1 do
local waitTime = game.ReplicatedStorage.Remove.Value
script.Parent.Show.Text = i
print(i)
game.ReplicatedStorage.Click:Play()
wait(waitTime)
end
script.Parent.Visible = false
script.Parent.Show.Text = tostring(game.ReplicatedStorage.Time.Value)
end)
game.ReplicatedStorage.TimeLeft.OnClientEvent:Connect(function(c)
script.Parent.Visible = true
for i = game.ReplicatedStorage.Time.Value,0,-1 do
local waitTime = game.ReplicatedStorage:FindFirstChild("Remove").Value
script.Parent.Show.Text = i
print(i)
game.ReplicatedStorage.Click:Play()
wait(waitTime)
end
script.Parent.Visible = false
script.Parent.Show.Text = tostring(game.ReplicatedStorage.Time.Value)
end)