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

Why won't this RemoteFunction work?

So this works in studio, but not in online [shocking IK, but not the main reason. they is a reason do not fear!]

So they click a gui then a black fades over the gloomy day.. then loading blah blah I got the rest coded.

Code:

			x1.MouseButton1Click:connect(function()
				print'does this fire 1'
				game.ServerScriptService.RemoteEvent:FireServer()
				print'does this fire 2'
				local b = game.Players.LocalPlayer.Character
				for i = 1, 0, -0.1 do
					print'does this fire 3'
					plr.PlayerGui.Background.Frame.BackgroundTransparency = i
					wait(0.1)
				end

error: (IN REAL GAME) ServerScriptService is not a valid member of DataModel It prints 'does this fire 1' (ofc)

p.s this is the first time i've officially used RemoteEvents and RemoteFunctions

thxxxxxxxxxxxxxxx

3 comments

1

You cannot access ServerScriptService from a local script. Put the RemoteFunction in ReplicatedStorage

0

Ah, thanks mate.

0

I'll make it an answer to the question so it can be genuinely marked as resolved.

1 answer

✓ Accepted answer

You cannot access ServerScriptService from a local script. Put the RemoteFunction in ReplicatedStorage.

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