I want the server script to change the value of an IntValue object ( to the value that was entered on the textbox in which the local script is located.
The client is there because roblox implicitly passes a reference to the player who fired the event. So from there you can do whatever you want to the player if you need to
well sir, simply put you added a ~ were it wasn’t needed you want the type of text to == “number” being you’re already casting it to a number, that and ur missing an end
In your code, the ~= checks if not equals. You would want to change it to == to check if text is a number.
local Event = game.ReplicatedStorage.LivesEvent
local Lives = game.ReplicatedStorage.Lives
Event.OnServerEvent:Connect(function(client, text)
if type(text) == "number" then
Lives.Value = text
end
end)