Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why Won't This Script Work [closed]

Asked by 10 years ago

I have been trying to make tycoon for the past two days with no luck its my very first tycoon and I just don't know where I am going wrong I have tried this script but with no luck btw this is for the bit where you touch the part become the owner of the tycoon

function GetOwner (h)
    if h:FindFirstChild("humanoid") then
        Game.Workspace.OwnerFinder.Name = (h)
        Game.Workspace.OwnerFinder:Remove()
    end
end

Script.Parent.Touched:connect(GetOwner)

Also I am changing the name of the brick itself for testing purposes soon it will be text above the brick but I need to know how to do that.

Closed as Not Constructive by evaera

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
2
Answered by
RedCombee 585 Moderation Voter
10 years ago
function GetOwner(h)
    if h:FindFirstChild("Humanoid") then
        game.Workspace.OwnerFinder.Name = h
        game.Workspace.OwnerFinder:Remove()
    end
end

script.Parent.Touched:connect(GetOwner)
Ad