FireServer is not a Valid Member of StringValue

I’m trying to make it so that when the client (there is a max of one player per server) inputs something into their TextBox it changes a Server side String Value. I tried using FireServer, but I’m getting this error:

Any help with this, is greatly appreciated.

EDIT: I found the issue, now my issue is that It doesn’t change the string value, any ideas.

Are you sure you’re indexing the remote properly? It looks like FindFirstChild is returning a StringValue, not a RemoteEvent. FindFirstChild returns the first child it finds with the name of the first argument you call it with. Make sure you call it with the correct name or it won’t work properly, alternatively if you have only 1 RemoteEvent you can call ReplicatedStorage:FindFirstChildOfClass("RemoteEvent") and see if that helps.

1 Like

I found the issue, now my issue is that It doesn’t change the string value, any ideas.

Hello there,
Please make sure you don’t have anything with the same name in ReplicatedStorage or this will cause and error.

If you don’t want to change the names then please define the class by doing:

if Instance:IsA(“BasePart”) then
end

One problem I see right off the bat is that you’re using an if statement for a function.

script.Parent:GetPropertyChangedSignal("Text"):Connect(function()
    -- Do stuff
end)

Is what it should look like instead of calling an if statement on it.

Hi, sorry I edited it now for some reason it won’t change the StringValue on the server side.

did you define the variable in the function??

Wait, good catch! I’ll change it. Thank you, let’s see if that works.

Should look like this:

local remoteEvent = ReplicatedStorage:FindFirstChild(“Duration”)

remoteEvent.OnServerEvent:Connect(function(val)
–the text is defined as “val” so if you edited a UI it would be like; script.Parent.TextLabel.Text = val
end)

1 Like


Here is what I currently have

I renamed the other duration, so that it doesn’t mess up the script.

False. Your first param needs to be the player that fired then the argument

Ah yes!
So it would be

remoteEvent.OnServerEvent:Connect(function(plr,val)
end)

Yes. That is what it should look like @j8cksxn

@j8cksxn Can you confirm in your script it looks like this at all?

What does your local script say?

1

@j8cksxn the “OnServerEvent” can only be ran from a script, not locally, you want to fireserver from a local script, and then it will be picked up by the OnServerEvent.

OK. You should move the ReplicatedStorage and the remoteEvent variable out of the function for better usage. And move the onServerEvent out of the function aswell. Also, you could add a print(val) to see if it’s what it should be.

1 Like

Oh yes what @WolfieTheDino said. Do all of that in a server script.

1 Like