Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

scripts breaking when not using solo?

so im experiencing a problem such that my scripts work perfectly fine while i test it in solo mode but as soon as i start server and play it most of the scripts do now work(some do though) this also occurs when my random people play the game do you know what the problem is?

Additional Info: Using local scripts Player can for some reason edit my textbox

local last = nil
local function turnOrange(new)
	if last ~= nil then
		if new.Name ~= last.Name then
			new.TextColor3 = Color3.new(227, 125, 0)
			last.TextColor3 = Color3.new(235, 235, 235)
		end
	else new.TextColor3 = Color3.new(235, 235, 235)
	end
	last = new
end 

for i, v in pairs(script.Parent.Parent:GetChildren()) do
	if v:IsA("TextButton") and v.Name ~= "Select" then
		v.MouseButton1Click:connect(function()
			turnOrange(v) 
		end)
	end
end



local last = nil
local function changeTransparency(new)
	if last ~= nil then
		if last.Name ~= new.Name then
			new.BackgroundTransparency = 0.5
			last.BackgroundTransparency = 1
		end
	else new.BackgroundTransparency = 1
	end
	last = new
end
for i, v in pairs(script.Parent.Parent:GetChildren()) do
	if v:IsA("TextButton") and v.Name ~= "Select" then
		v.MouseEnter:connect(function()
			changeTransparency(v)
		end)
	end
end

2 answers

Well I do know that when you are in Studio>Test>PlaySolo all scripts will be ran as LocalScripts. Because of this you may have some scripts that you need to switch to a LocalScript that are currently just Scripts causing them to not work In-Game. I had that problem before.

1 comment

0

Didn't Wall142 say the same thing I said?

Well, for your scripting problems, you may be using the wrong scripts for the wrong purposes they were made for. Here's some info on how you can fix those problems:

When should you use a LocalScript and when should you use a Script?

As for the TextBox, make sure you're using a TextLabel. Users can't edit them and you can only modify the text using script events.

Hopefully this helps you! :)

2 comments

0

i edited and gave an example of my script not working

0

its supposed to make the textbutton background transparency change works fine in solo but doesnt work when not in solo

This discussion is preserved as it was. New answers, comments, and votes are closed.