`bool = true local player = game.Players.LocalPlayer local mouse = player:GetMouse() script.Parent.Parent.Parent.Equipped:Connect(function() while bool == true do wait() script.Parent.Text = mouse.Target end end)
script.Parent.Parent.Parent.Unequipped:Connect(function() bool = false end) `
COMMUNITY QUESTION
How do I fix an error that says: "string expected, got instance'?
2 answers
You can click the blue circle to format the code better but i believe its because of this line
script.Parent.Text = mouse.Target
you are setting a text property which needs to be a string to the entire object you are targetting, maybe you meant to use mouse.Target.Name
local bool = true
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
script.Parent.Parent.Parent.Equipped:Connect(function()
while bool == true do
wait()
script.Parent.Text = CFrame(mouse.Target.Position)
end
end)
script.Parent.Parent.Parent.Unequipped:Connect(function()
bool = false
end)
this error meens it expected to get a string but instead got a int.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
btw CFrame meens coordinate frame.
thats not how you use cframe, thats not what he wants and thats not how you spell (im being a hypocrite when i said that)