currently making a information system, however I am getting this output Unable to assign property Text. string expected, got nil
Here are my scripts for reference
server
for _,DialogRigs in pairs(Miscellaneous.Rigs.DialogRigs:GetDescendants()) do
if DialogRigs:IsA("ProximityPrompt") then
function OnProximityActivated()
local RigUserID = DialogRigs.Parent.Parent.userId
local User = Players:GetPlayerByUserId(RigUserID.Value)
Events.Dialog:FireClient(User)
end
DialogRigs.Triggered:Connect(OnProximityActivated)
end
end
client
Events.Dialog.OnClientEvent:Connect(function(User)
DialogFrame.Username.Text = User
DialogFrame.ImageLabel.Image = Players:GetUserThumbnailAsync(User.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
end)
that’s not what im trying to create. Basically I have a rig that displays any player’s avatar you just enter in their user ID and I want it so when you activate the proximity prompt a gui shows up that says their name and other stuff
Proximity prompts give you the player who triggered it, so you can use that to send the User info to it (if I understood you correctly)
for _,DialogRigs in pairs(Miscellaneous.Rigs.DialogRigs:GetDescendants()) do
if DialogRigs:IsA("ProximityPrompt") then
function OnProximityActivated(prompt, plr)
local RigUserID = DialogRigs.Parent.Parent.userId
local User = Players:GetPlayerByUserId(RigUserID.Value)
Events.Dialog:FireClient(plr, User)
end
DialogRigs.Triggered:Connect(OnProximityActivated)
end
end
When you fire a remote event from server to client, the first parameter is just a reference for who the client fires to. Changing the event on the server to Events.Dialog:FireClient(User,User) will work. Also, you’ll have to do User.Name since its a player instance and not a string.
function OnProximityActivated(prompt, plr)
Remove the ‘prompt’ parameter.
When you do DialogRigs.Triggered:Connect(OnProximityActivated)
It does OnProximityActivated(PlayerThatTriggeredIt)
so prompt will be the player instance.