Yes and no. I just now commented out the line that should be spectating the player, but it STILL WORKS FINE. How is this even possible?!
local cam = workspace.CurrentCamera
local button = script.Parent
pchosen = 0
button.MouseButton1Click:Connect(function()
pchosen = pchosen + 1
if pchosen > #game.Players:GetPlayers() then
pchosen = 1
end
script.Parent.Parent.CharacterLabel.Text = tostring(game.Players:GetPlayers()[pchosen])
--cam.CameraSubject = game.Players:GetPlayers()[pchosen].Character.Humanoid <<HOW?!
end)
Seriously, have a look at the Un-Copylocked place above and please tell me what is happeningā¦
Do you have any other scripts? Try doing ctrl + shift + f and typing a period (finds all scripts with a period, most scripts have one). You might have duplicated a older version.
Nope, I didnāt duplicate anything. I donāt think this is a Studio problem because I have uninstalled and reinstalled Studio today. Do you think Studio could have been infected? I doubt, though, that THIS would be the virus payload, it would probably be a backdoor or something.
Does deleting the script stop it?
What script do you refer to?
The script that runs spectating. (Sorry, I canāt view the place on mobile.)
There are two scripts that run spectating. Are you referring to the one where it detects the player input to change the player being spectated? If so, then yes, it stops all mouse input operations. I donāt think my problem is a duplicate script.
So the problem is a line of code running when you comment it out? Is the line in both scripts?
No, just one script.
Hehe, a minor question. If you are in team create mode, do you have to close the script window for changes to actually save?
I dont usually use team create due to security breaches, but yes, you have to close the script.
I just tested, and if you do Alt+P (Publish), script changes will still save. Hmm, thatās not the problemā¦
Youāre doing something wrong somewhere, can you post a video or gif of EXACTLY what you are doing to disable the script? I just commented out the exact same line and it disables it properly: https://gyazo.com/5b03c2011ec863f14a951aae06856afb
For reference, here is without the comment: https://gyazo.com/3c58f0f93ebf207357ad8a7d3824b787
Are you sure you are using the āāā before properly?
1 Like
I think I have made one of the dumbest programming mistakes ever in Roblox Studio. Lol, I was probably not closing the script before publishing. Thank you guys!
2 Likes