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

String manipulation isn't working?

player.Chatted:connect(function(message)
	if player:GetRankInGroup(groupid) >= 1 then
		if message:sub(1,10) == "!outscore " then
		local outscore = message:sub(11)
		ServerScript.Leaderboard:FindFirstChild("Outscore").Value = outscore
		wait(1)
		game:GetService("StarterGui"):SetCore("ChatMakeSystemMessage",{
		Text = "You have changed the outscore to "..outscore..".";
		Color = Color3.new(0,1,1)
		})
		end
		end
	end)

The objective here is for a player to say "!outscore " and then a number, and then it'd tell the player what they changed the outscore to.

It completely works in studio, however it doesn't work in online mode. The script is a LocalScript, and nothing is printing in the output.

Yes, I've checked the hierarchy, I have no clue what the problem here is.

1 comment

0

Maybe your trying to make an intvalue have a string inside it?

1 answer

The problem is that, with local scripts, they do not have access to the server storage and server script service , try using remote events to signal a script to change the out score, or put the leaderboard script in the workspace.

2 comments

0

I'm quite sure his script isn't a local script. You're right though.

0

"The script is a LocalScript, and nothing is printing in the output." - It's a LocalScript.

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