Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I have a problem in my script that needs to display a name, can you help me?

I'm creating a Tycoon but when I touch the door at the beginning it doesn't display my name here's the script:

owned = script.Parent.Parent.Parent.Owned
owner = script.Parent.Parent.Parent.Owner

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		if owned.Value == false then
			owner.Value = hit.Parent.Name
			owned.Value = true
		end
	end
end)

1 comment

0

Are you sure you're setting it up properly? Watch this video https://www.youtube.com/watch?v=zERse9_DAYk

1 answer

Try this. I swapped 2 lines. This should work as it set's the value to true first.

owned = script.Parent.Parent.Parent.Owned
owner = script.Parent.Parent.Parent.Owner

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if owned.Value == false then
            owned.Value = true
             owner.Value = hit.Parent.Name
        end
    end
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.