One local script in a submit button, a remote event and a script to recieve the event.
The script won’t recieve the event or the local script wont fire it.
Local Script
script.Parent.Activated:Connect(function()
if script.Parent.Parent.TextBox.Text ~= nil then
script.Parent.RemoteEvent:FireServer(script.Parent.Parent.ScrollingFrame.Value.Value, script.Parent.Parent.TextBox.Text)
print(script.Parent.Parent.ScrollingFrame.Value.Value)
script.Parent.Parent.Visible = false
end
end
)
Personally, I’d just put the RemoteEvent inside ReplicatedStorage as there are just some places that these objects can’t function right on
-- Client Side
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
local Button = script.Parent
local ScrollingFrame = Button.Parent.ScrollingFrame
Button.Activated:Connect(function()
if Button.Parent.TextBox.Text ~= nil then
Event:FireServer(ScrollingFrame.Value.Value, Button.Parent.TextBox.Text)
print(ScrollingFrame.Value.Value)
end
end)
--Server Side (Preferably inside ServerScriptService)
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")
Event.OnServerEvent:Connect(function(Plr, Medicine, Dose)
print(Plr, Medicine, Dose)
end)
You might need to place your remote event into Replicated Storage. I’m not sure what your hierarchy is, but it is possible that one of the scripts isn’t able to see it because of its placement. Try that and see if it helps!
First off all, place the remote event in ReplicatedStorage, the server-sided script cannot fire a remote event which is inside player
Second, only you can keep bindable events in player, never keep remote events in player, always keep in replicated storage or workspace
Third, run a print function at end and start of the remote event firing function, if both of them are printed, then no error, if it did not print then use a pcall function and print the error
Four, scripts never work on player, don’t even keep a script inside player, you did that
im having a similar issue to this. i scripted a GUI that will move a folder inside a players backpack, and i filled it with test scripts (server sided)
Don’t you know how remote event works? In the DevHub API they clearly told, remote events should be kept where both server and client can access, server cannot access client-internal data
Do not post false posts, if your not sure, just telling because you know that would make the OP angry and the person your replying to a misleading post
Putting my last note over here, I said excluding the server, meaning putting the event inside a gui I don’t see a problem with that (Because the client and server can access it), it’s only a problem when you parent the gui through client
What you are saying is that server do not have access to GUI’s? mousebutton1click works both client and server