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

Used the changed function wrong or I did the script wrong? [closed]

Asked by
Hydrogyn 155
7 years ago

Here's the code I did. [Attempt 1] [ Game does not have FE enabled, for all attempts ]

game:GetService("Players").LocalPlayer.Backpack.Tool.Parent.Changed:connect(function()
    local plr = game:GetService("Players").LocalPlayer.Character.Name
    if game:GetService("Players").LocalPlayer.Backpack.Tool.Parent == game:GetService("Players").LocalPlayer.Character.Name then
        script.Parent:FindFirstChild("Frame").Visible = true
    else
        script.Parent:FindFirstChild("Frame").Visible = false
    end
end)

I maybe used the Changed function in a wrong way, but I changed a bit of things

game:GetService("Players").LocalPlayer.Backpack.Tool.Parent.Changed:connect(function()
    local plr = game:GetService("Players").LocalPlayer.Character.Name
    if game:GetService("Players").LocalPlayer.Backpack.Tool.Parent == plr then
        script.Parent:FindFirstChild("Frame").Visible = true
    else
        script.Parent:FindFirstChild("Frame").Visible = false
    end
end)



0
Nvm, I found my mistake. Thanks for helping no one... Hydrogyn 155 — 7y

Locked by RubenKan

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?