Here's the code. It doesn't work in studio. In the Local Script:
script.Parent.MouseButton1Click:Connect(function()
local function serverusernamekill()
local usernamekill = script.Parent.Text
return usernamekill
end
serverusernamekilltoserver = serverusernamekill()
serverusernamekilltoserver:InvokeServer()
end)
In the Normal Script:
function serverusernamekilltoserver:OnServerInvoke()
print("cake")
end
Here's the thing. The "script.Parent.Text" part in the first part is grabbing the text from a button, for context. It then puts it in a variable and returns it in a function so I can pass it to the normal script. I put the function in a variable so I can use "InvokeServer()" with it. I add it to InvokeServer(), but then I get the error "attempt to call method 'InvokeServer' (a nil value)". Can anyone help? :D
Solved. Also, if a local script from ReplicatedStorage is firing to a global script in ServerStorage, move that global script to ServerScriptService if it's not responding. I didn't accept this answer cause I made that mistake and thought it was somehow a problem with this script. Thanks for the reply!

1 comment
Solved. Also, if a local script from ReplicatedStorage is firing to a global script in ServerStorage, move that global script to ServerScriptService if it's not responding. I didn't accept this answer cause I made that mistake and thought it was somehow a problem with this script. Thanks for the reply!