I’ve tried figure out long as is was possible, but I’m still stuck with the issue.
Mainly I wanna make the UI that let’s players change amount of Apple if it’s lower then it should warn them.
Local script:
local changedValue, changedAmount, message = changeApples:InvokeServer("changeApple,appleToPass")
elseif message == "Max Apple Pack" and changedAmount ~= nil then
appleLabel:WaitForChild("messageLabel").Text = message
Server:
Events.changeAppleRemote.OnServerInvoke = (function(plr,whichAction,changedAmount,message)
if whichAction == "changeApple" then
if type(changedAmount) == "number" then
if changedAmount < 3 then
whichAction = message
if message then
message = "Too low! Lowest Apple set"
end
end
appleToPass is amountBox.Text on UI
The problem is when I type anything it gets nil value instead string one(message)
The server is expecting a message. Get rid of that and the script should at least run since the 3rd argument is going to be nil since you provided no parameter value in line :
So change it to
local changedValue, changedAmount, message = changeApples:InvokeServer(“changeApple”, appleToPass, **YOUR MESSAGE GOES HERE as the server expects it**)
local appleToPass = tonumber(amountBox.Text)
if appleToPass == nil then
amountBox.Text = amountBox
dSound:Play()
return
end
local changedValue, changedAmount, message = changeApples:InvokeServer("changeApple",appleToPass)