Turning a local script into a function

1/1, clear and not hard, you explained it like teacher…

If you can please help me:

Running into error FireServer not a Valid member of script?

have it wrote out I would think correctly

and my Rep Storage Script

sorry still not following 100% why this won’t link them correctly

please tell me what you tried with event:fireserver(“player.eqippedpet.Value=petname”)

Ok, Change code

Event.Name = "SomeEvent"


Event.Name = "PetRemote"

Also, change

local Event = game.ReplicatedStorage.Bang


local Event = game.ReplicatedStorage.PetRemote
1 Like

And, you should change

Event:FireServer("player.EquippedPet.Value = petName")



this doesn’t help with the error FireServer not a vail member of script?
petName was underscored so I added l added

local petName = player.EquippedPet.Value

that helped the red but not the error

Is PetRemote(Script) in Replicated Storage?
Please change the name
PetRemote is automatically generated by the code.

-- command bar
local Remote = Instance.new('RemoteEvent')
Remote.Name = 'Remote Event stuff'
Remote.Parent = game:GetService('ReplicatedStorage')

-- server
local Replicated = game:GetService('ReplicatedStorage')
local Event = Replicated['Remote event stuff']

Event.OnServerEvent:Connect(function(Player, PetName, ...)
	-- The player instance is passed automatically and is always the first parameter in OnServerEvent.
	print(Player .. ' | ' .. PetName)

-- client
local Replicated = game:GetService('ReplicatedStorage')
local Event = Replicated:WaitForChild('Remote event stuff')

Event:FireServer('Pet name')

Try to see if the issue still occurs.