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

when one script is not disabled the other dose not work how do i fix?

Asked by 5 years ago

the chest script

script.Parent.MouseClick:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    local plr = game.Players.LocalPlayer

 for d,tools in pairs(plr.Backpack:GetChildren()) do 

    local i = Instance.new("TextLabel")
    local find = plr.PlayerGui:FindFirstChild("pack")
    i.Parent = find.Back
    if tools:IsA("Tool") then   
        i.Text = tools.Name
        find.Back.Visible = false
        print(tools.Name)
    end
    end
end)

the GUI script/Localscript


local plr = game.Players.LocalPlayer for d,tools in pairs(plr.Backpack:GetChildren()) do local i = Instance.new("TextButton") i.BackgroundTransparency = .5 local find = plr.PlayerGui:FindFirstChild("pack") i.Parent = find.Back if tools:IsA("Tool") then --local clone = tools:Clone() --clone.Parent = script.Parent.wopens tools.Parent = script.Parent.wopens i.Text = tools.Name print(tools.Name) i.MouseButton1Click:Connect(function() local cop = script.Parent.wopens:FindFirstChild(i.Text) cop:Destroy() i:Destroy() end) end end
0
server scripts cannot get the localplayer theking48989987 2147 — 5y
0
could you explain more pls User#23365 30 — 5y
0
I mean, if you tell a teacher to get the local student, the teacher is going to be extremely confused theking48989987 2147 — 5y
0
^ User#19524 175 — 5y
0
local player = game.Players:GetPlayerFromCharacter(hit.Parent) turtle2004 167 — 5y

Answer this question