Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

InvokeClient not communicating properly. What do i do?

Asked by 5 years ago

i have a ServerScript inside a textbutton inside a frame inside a surfaceGui on an object. The script has this line:

local CheesyBreadLeft = ValueFetcher:InvokeClient(player[1],"CheesyBread")
print(CheesyBreadLeft)

its should print 20. but it says nil

this is the local script in starter Gui

function ValueFetcher.OnClientInvoke(value)
    print(value)
    if value == "CheesyBread" then
        print(script.Parent:WaitForChild("Cheesy Bread").Value)
        return script.Parent:WaitForChild("Cheesy Bread").Value
    end

if i print out value, it says nill. So i think the server script isnt sending the right info

Answer this question