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

FireServer is not a valid member of script?!

hello devs

I got some help setting up my first RemoteEvent yet it still doesn't work and gives the error

FireServer is not a valid member of script

my tiny brain is not following why its happening due to looking at the script and its flawless (to me)

my local script(inside a shop GUI) is

local Event = game.ReplicatedStorage.PetRemote
Event:FireServer(petName)

and my remote event (RepStorage) is

local Event = Instance.new(game.ReplicatedStorage.PetRemote)
Event.Name = "PetRemote"
Event.OnServerEvent:Connect(function(Player,Value)
	  print("Value received from client, Player:",Player.Name,"Value:",Value)
end)

Won't Print

7 comments

0

Can you please format your script into a code block?

0

would it be easier to not create a new event?

0

yeah use the code block

0

ok sorry guys new to this site

0

I made them both code blocks, It has to be a new event due to im trying to contact server from local script

0

remove lua

0

yea

1 answer

I don't understand what you're doing. Here, make sure there's already a remote in ReplicatedStorage called "PetRemote":

local Event = game:GetService("ReplicatedStorage"):WaitForChild("PetRemote") -- Getting the remote, I don't know why you did Instance.new
Event.OnServerEvent:Connect(function(Player,Value)
      print("Value received from client, Player:",Player.Name,"Value:",Value)
end)

Hope this helps

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