Oh, I think I found a problem.
On this part, you should only store objects. This is because if you store the value, it becomes just a number.
Oh, I think I found a problem.
On this part, you should only store objects. This is because if you store the value, it becomes just a number.
so how do i fix it, any solutions
Delete .Value
parts. And add .Value
beside of questactive or complete. ex: questactive.Value = true
ok let me try for a bit, be right back
Also, when did you start programming in Roblox? When I look at the code, I see some bad parts. And, like this problems, you can use Roblox Assistant. It may help you a lot.
yea my bad, just started like almost a year ago with out trainning and just guides
also, i think it works but still shows the same problem
i think the main problem is around this script
local collected = script.Parent.Parent.Collected
local rep = game.ReplicatedStorage
local limit = script.Parent.Parent.Limit
local questactive = script.Parent.Parent.QuestActive
local questcomplete = script.Parent.Parent.QuestComplete
rep.RemoteEvents.Trash.OnClientEvent:Connect(function(plr)
print("got event")
if questactive.Value == true then
print(collected.Value)
collected.Value = collected.Value + 1
script.Parent.Counter.Text = tostring(collected.Value).."/"..tostring(limit.Value)
end
end)
if questactive.Value == true then
script.Parent.Counter.Text = tostring(collected.Value).."/"..tostring(limit.Value)
while task.wait() do
if collected.Value == limit.Value then
questcomplete = true
print("Quest completed")
break
end
end
end
Check in the game to see if the questactive value changes properly.
yea it changes, but still doesnt change the text
can the code print out collected.Value properly?
oh i thought you were talking about limit value, my bad but no the collect value doesnt changes
local collected = script.Parent.Parent.Collected
local rep = game.ReplicatedStorage
local limit = script.Parent.Parent.Limit
local questactive = script.Parent.Parent.QuestActive
local questcomplete = script.Parent.Parent.QuestComplete
rep.RemoteEvents.Trash.OnClientEvent:Connect(function(plr)
print("got event")
if questactive.Value == true then
print(collected.Value)
collected.Value = collected.Value + 1
script.Parent.Counter.Text = tostring(collected.Value).."/"..tostring(limit.Value)
end
end)
if questactive.Value == true then
script.Parent.Counter.Text = tostring(collected.Value).."/"..tostring(limit.Value)
while task.wait() do
if collected.Value == limit.Value then
questcomplete = true
print("Quest completed")
break
end
end
end
yes it doesnt changes, only the limit value changes
19:50:50.761 5 - Client - LocalScript:14
19:50:58.794 Quest started - Client - LocalScript:27
19:52:29.005 got event - Client - LocalScript:8
19:54:10.683 Disconnect from ::ffff:127.0.0.1|53673 - Studio
the “got event” referese to the trash bag firing the remote and the local script catching it
script.Parent.Counter.Text = tostring(collected.Value).."/"..tostring(limit.Value)
If you put print()
in if questactive == true then
part, what happened?
print which value? the collective value
anything ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ ㅤ
WAIT i think i know the problem