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

Why do I get this error message, "FireServer can only be called from the client"?

bin = script.Parent

function onTouched(part)
	
	

	workspace.OBJCONTROL.Obj1:FireServer()
	workspace.TALKCONTROL.Talk1:FireServer()
end


connection = bin.Touched:connect(onTouched)


I have this script in a part in the workspace, and it is a LocalScript. It gives the the error message, FireServer can only be called from the client. The Remote Event is in a folder in the workspace too, and that connects to a GUI that allows it to change text,



game.workspace.TALKCONTROL.Talk1.OnServerEvent:connect(function(change)
	
	script.Parent.TextLabel.Text='The servers are running fine. Weird..'
		wait(7)
	script.Parent.TextLabel.Text=''
end)


game.workspace.TALKCONTROL.Talk2.OnServerEvent:connect(function(change)
	
	script.Parent.TextLabel.Text='Maybe I should look for co-workers.'
		wait(4)
	script.Parent.TextLabel.Text=''
	
end)

game.workspace.TALKCONTROL.NPC.NPCT1.OnServerEvent:connect(function(change)
	script.Parent.TextLabel.Font="SourceSans"
	script.Parent.TextLabel.Text="What's going on?!"
		wait (3)
	script.Parent.TextLabel.Text=''
		wait (3)
	script.Parent.TextLabel.Text="Is anyone else here?"
		wait (3)	
	script.Parent.TextLabel.Text=''
		wait (3)
	script.Parent.TextLabel.Text="I'll look for others, you should look for an exit."
		wait (3)
	script.Parent.TextLabel.Text=''
		wait (3)
	script.Parent.TextLabel.Text="I will. Bye."
	game.Workspace.OBJCONTROL.Obj3_5:FireServer()
		wait (3)
	script.Parent.TextLabel.Text=''
end)

game.workspace.TALKCONTROL.Talk3.OnServerEvent:connect(function(change)
	script.Parent.TextLabel.Font="SourceSansItalic"
	script.Parent.TextLabel.Text='None of the lab guys are here today. Weird.. Maybe I should check the Announcement board.'
		wait (4)
	script.Parent.TextLabel.Text=''	
end)


	
game.workspace.TALKCONTROL.Talk4.OnServerEvent:connect(function(change)
	script.Parent.TextLabel.Text="A bombing?? I gotta get outta here!"
		wait (4)
	script.Parent.TextLabel.Text=''	
end)


Please help. Also, if I am not clear enough, do let me know.

1 comment

0

you can't have a local script in workspace

2 answers

The LocalScript should just be a regular script. Simple as that.

2 comments

0

If this doesn't work, please let me know. I tested it in studio, not online mode, so it might not work there.

0

Yeah it won't work online

You can simply move the local script from the part into the the StarterPack. Then re-edit the code like:

bin = game.Workspace.(name of the part) --You should rename the part so you can find it

bin.Touched:connect(function()  
workspace.OBJCONTROL.Obj1:FireServer()
workspace.TALKCONTROL.Talk1:FireServer()
end)

2 comments

0

It still gives the same error....

0

I don't know why then, it works for me.

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