Now, these scripts always work fine the first time I run them, but after that, the second script I listed will sometimes only run up to line 12 and then won’t finish the iteration for whatever reason, but it never throws an error, and it will then work if I fire the event again. I have absolutely no idea why this is happening and would love some insight. Thanks
Honestly, I’m having a similar issue. For the past few days I’ve noticed client-sided code only works sometimes. Despite the fact that I didn’t change anything. Roblox has been having issues lately, it could be related but I’m not sure.
I’ve noticed this started happening since I updated studio. Out of curiosity are you using macOS or Windows? I’m on macOs so sometimes it takes a little longer for Roblox staff to straighten out bugs that come with updates.
If you said that the 12nd line of your script is this line
Start.SurfaceGui.TextLabel.Text=("")
Then try this instead?
Start.SurfaceGui.TextLabel.Text=3
task.delay(1,function()
Start.SurfaceGui.TextLabel.Text=2
task.delay(1,function()
Start.SurfaceGui.TextLabel.Text=1
task.delay(1,function()
Start.SurfaceGui.TextLabel.Text=(" ") -- i added a space in the "" just in case
Start.CanCollide=false
Start.Transparency=1
Start.ClickDetector.MaxActivationDistance=0
while Start.Parent.Value.Value==false do
wait(0.1)
Count=Count+1
GUI.Text=(Count/10)
print("hi")
end
Start.CanCollide=true
Start.Transparency=0
Start.ClickDetector.MaxActivationDistance=32
Start.Parent.Value.Value=false
end)
end)
end)
-- i may miss something in this scirpt because i didn't script in roblox studio btw
Also recently, i don’t find much of a errors that occur in my cilent script, probably because something went wrong with your script or it’s just too soon for me to find it
Tried this and had the same issue. it works like 70% of the time despite the fact that literally nothing changes
Thanks a lot for putting the time into writing this though
Start.CanCollide=false
Start.Transparency=1
Start.ClickDetector.MaxActivationDistance=0
while Start.Parent.Value.Value==false do
wait(0.1)
Count=Count+1
GUI.Text=(Count/10)
print("hi")
end
Start.CanCollide=true
Start.Transparency=0
Start.ClickDetector.MaxActivationDistance=32
Start.Parent.Value.Value=false
Everything before that always runs, but yea, about 30% of the time, all of that doesnt run.
I tried putting
print(Start.CanCollide)
after
Start.CanCollide=false
And it printed false, but in the workspace it still showed as true, and I still couldnt walk through the part. It’s like the script can see what’s happening, but the client can’t which doesn’t make sense since the script is running on the client blaargghhhh
Yes, only if the gui is inside player’s StarterGui which will work as a cilent and if it’s a descendant of another part which is not a players will not occur because the cilent doesn’t do anything to server.
So if the gui is a descendant of a model that is not a player, the script won’t work.
I just noticed that your script change the CanCollide twice
Start.CanCollide=false -- here
Start.Transparency=1
Start.ClickDetector.MaxActivationDistance=0
while Start.Parent.Value.Value==false do
wait(0.1)
Count=Count+1
GUI.Text=(Count/10)
print("hi")
end
Start.CanCollide=true -- here
Start.Transparency=0
Start.ClickDetector.MaxActivationDistance=32
Start.Parent.Value.Value=false
Which will only set the part canCollide to true
So aftter setting the part CanCollide to false
Do this instead :
Start.CanCollide=false
Start.Transparency=1
Start.ClickDetector.MaxActivationDistance=0
while Start.Parent.Value.Value==false do
wait(0.1)
Count=Count+1
GUI.Text=(Count/10)
print("hi")
end
task.delay(1,function() -- change how long you want it to start canCollide = false
Start.CanCollide=true
Start.Transparency=0
Start.ClickDetector.MaxActivationDistance=32
Start.Parent.Value.Value=false
end)
I will try this and get back to you, but the idea is that when the value of “Start.Parent.Value” is set to true (by a different local script) the while loop is broken and the parts cancollide is instantly set to true. So I don’t see what your code will change other than adding the 1 second delay
not really sure what you need help with but the LocalScript could look a bit better
-- learn to add 'local' and spaces between variable names
local Player = game:GetService("Players").LocalPlayer
local TextLabel = script.Parent.TextLabel -- the textlabel isn't your gui
local StartRE = game.ReplicatedStorage.Start.Start -- rename 'Start' to avoid repitition
local function Start(Start)
local StartLabel = Start.SurfaceGui.TextLabel -- make a variable for easier reuse
-- use a for loop instead of counting down manually
for i = 3, 1, -1 do
StartLabel.Text = i
task.wait(1)
end
StartLabel.Text = ""
Start.CanCollide = false
Start.Transparency = 1
Start.ClickDetector.MaxActivationDistance = 0
local Count = 0
repeat
task.wait(0.1)
Count += 1
TextLabel.Text=(Count/10)
print("0.1 sec") -- prints should make more sense
until Start.Parent.Value.Value -- rename 'Value' to avoid repitition
Start.CanCollide = true
Start.Transparency = 0
Start.ClickDetector.MaxActivationDistance = 32
Start.Parent.Value.Value = false
end
StartRE.OnClientEvent:Connect(Start)
Ok buddy listen up. I don’t know what kind of witchcraft or black magic it is but somehow you fixed it and I really can’t figure out why this works and mine doesn’t. Fair enough. Thank you.