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

The Image Label Appear On Studio But Not In Game. What Is The Problem?

Asked by 6 years ago
Edited by M39a9am3R 6 years ago
local inputservice = game:GetService("UserInputService")

inputservice.InputBegan:connect(function(i,g)
    if i.UserInputType == Enum.UserInputType.Keyboard then
        if i.KeyCode == Enum.KeyCode.Return then
            for _,Door in pairs(workspace.Doors:GetChildren()) do
                local Mag = (Door.Center.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
                if Mag <= Door.Range.Value then
                    Door.Event:FireServer()
                    break
                end
            end
        end
    end
end)

while wait() do
    script.Parent.ImageLabel.Visible = false
    for _,Door in pairs(workspace.Doors:GetChildren())do
        local Mag = (Door.Center.Position-game.Players.LocalPlayer.Character.HumanoidRootPart.Position).magnitude
        if Mag <= Door.Range.Value then
            local D3ToD2 = workspace.CurrentCamera:WorldToScreenPoint(Door.Center.Position)
            script.Parent.ImageLabel.Visible = true
            script.Parent.ImageLabel.Position = UDim2.new(0,D3ToD2.x,0,D3ToD2.y,0)
            break
        end
    end
    wait()
end
0
WHY ARE WE SHOUTING? MachoPiggies 526 — 6y
0
Imsorry. I just did that for Someones attention. Sorry Again OniSanYamate -17 — 6y
0
Edited for more appropriate title. M39a9am3R 3210 — 6y
0
Is this a Server Script, or a LocalScript? Are you able to provide more details on the script than what you just have in the question title? What have you done to try and find a source of error in the script? M39a9am3R 3210 — 6y
0
Where is the server script? awesomeipod 607 — 6y

Answer this question