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

How can I check if an user has something in his model located in Workspace?

Asked by
Kegani 31
6 years ago
Edited 6 years ago

Hello

I am currently trying to make a tracker for my Hunger Games group which is currently only obtainable with a morph giver thing.

With this tracker, I am trying to make it so I can use a GUI to get all status about the player (health, dead/alive, etc..).

However, I'm lost. I'm using a value that contains the text input here (http://prntscr.com/inu5y5) and I'm trying to get the script to locate the user in Workspace by using the text I put in the TextBox.

I've also tried using the PlayerAdded and CharacterAdded events, in vain.

Here is my script:

function onClick(noot)
    local val = script.Parent.Parent.TextBox.Value.Value
    local text = script.Parent.Parent.TextBox
    val = text.Text
    local tracker = game.Workspace.val:findFirstChild("Arm1")
    if tracker == nil then
        script.Parent.Parent.error.BackgroundTransparency = 0.5
        script.Parent.Parent.error.TextTransparency = 0
    end
end

script.Parent.MouseButton1Click:connect(onClick)

Arm1 is the tracker. Here's where's everything is located: http://prntscr.com/inu6qm

I'm not asking to be spoonfed, but I'm honestly lost. I'd appreciate some help so I can finally understand. Thanks!

0
try; if Tracker ~= nil then AttentionHog 70 — 6y
0
Same error "val is not a valid member of Workspace". Kegani 31 — 6y

Answer this question