- What do you want to achieve? Keep it simple and clear!
I am making a projector that uses an event and fires it when the textbox losses focus from the player using it. The textbox takes the “ImageID” and puts this ID into the surfaceGUI of the projector screen.
- What is the issue? Include screenshots / videos if possible!
The issue is that I am getting this error:
Workspace.ProjectorScreen.EnterImage:2: attempt to concatenate string with Instance – Line 2 of my server script.
Server script (OnServerEvent)
game.ReplicatedStorage.ProjectObject.OnServerEvent:Connect(function(text)
script.Parent.ProjectedObject.Image.Image = "rbxassetid://"..text
print("Image successfully displayed")
end)
Local script (inside textbox)
script.Parent.FocusLost:Connect(
function(enterPressed)
if enterPressed then
local text = script.Parent.Text
game.ReplicatedStorage.ProjectObject:FireServer(text)
print("New image displaying")
end
end
)
What am I doing wrong? I never experienced this type of error.
There is a RemoteEvent inside of ReplicatedStorage.