So pretty much I'm trying to make a textbox in which the player inputs a users name and it gets the ID and applies said ID to a dummy. I know how to get the ID, in fact it works like a charm for printing, however it gives me the error, "Unable to cast value to object" whenever I try to apply the ID to the Dummy. Here are both codes: Client/Local Script:
local Players = game:GetService("Players") local textbox = script.Parent textbox.ClearTextOnFocus = true textbox.PlaceholderText = "Enter friend or random user's username" local colorNormal = Color3.new(1, 1, 1) local function onFocused() textbox.BackgroundColor3 = colorNormal end textbox.FocusLost:Connect(function(enterPressed, inputObject) if enterPressed then local text = textbox.Text local id = Players:GetUserIdFromNameAsync(text) game.ReplicatedStorage.dname:FireServer(id) end end)
Server Script:
local dname = game.ReplicatedStorage:FindFirstChild("dname") dname.OnServerEvent:Connect(function(player, id) print(id) game.workspace.Dummy.Humanoid:ApplyDescription(id) end)
I've been searching of ways to fix this for hours now and I finally gave up and came to get help. If anyone knows why it isn't working I would be very grateful if you helped me out! Tysm!
hey you! have you ever heard of enes? if you are in trouble, better call enes!