What do you want to achieve?
get the choice variable across correctly to a server script without needing to hard code it.
What is the issue?
It replaces the choice variable data with the plr variable data
What solutions have you tried so far?
Changing remote event to remote function and applying the changes necessary.
I can assure that the path to the instances are not wrong.
local script in startercharacterscripts:
local dialog = workspace.AranDev.Head:FindFirstChild("Dialog")
dialog.DialogChoiceSelected:Connect(function(plr, choice)
print("player name is: ".. plr.Name)
print("choice name is: ".. choice.Name)
game.ReplicatedStorage:WaitForChild("GiveGear"):FireServer(plr, choice)
end)
to avoid hard coding, i made it so the choice names have the same names as the tools.
In the local script, choice.Name is Sword
In the server script, choice.Name is AranhaDev (my name)
^ should be the same as the local script
The behaviortype of the dialog is singleplayer (if thats what you mean im not sure if i have another way of detecting if its server or client) making it client only i guess. How would i work around this then?
If the dialogue is only in the client, the server won’t be able to see that object at all (Attempting to send a variable only existing to the client to the server would just return nil because the server doesn’t recognize it). A workaround would be to create the dialogue on the server side, so both can see it.