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

Script won't find a child in Server Storage when the player sends the name, What am i doing wrong?

Asked by 2 years ago

I tried to make a script to check if the input is a valid child, but it doesn't find the child, here is the script

local funct = game.ReplicatedStorage:WaitForChild("Gamepass2")

-- this part works

if game.ServerStorage.Events:FindFirstChild("Tornado") then
    print("why?")
end

-- this one is broken for some reason

funct.OnServerInvoke = function(plr, check)

    print(check)

    if check == game.ServerStorage.Events:FindFirstChild(check) then

        print("yes")

    else

        print("no")

    end

end

I use the remote function, so I can return a value to the player.

Answer this question