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

Script not running at all not even prints?

Asked by
MattVSNNL 620 Moderation Voter
3 years ago

So I made a script that will detect when it's a door it shows a little gui to interact, But my code isn't even running, Even prints on the top isn't working, Can anyone help me, Literally any code will not run at all, It might also be the fact it's in replicatedStorage, Can anyone help?

game:GetService("Players").PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(char)

        for _, v in pairs(workspace:GetDescendants()) do
            if v:FindFirstChild("Interactable") then

                local magnitude = (v.Position - char:FindFirstChild("HumanoidRootPart").Position).magnitude

                print(magnitude)

                if magnitude <= script.Parent:FindFirstChild("InteractGui"):FindFirstChild("InteractBoard").MaxDistance then

                    print("In sight!")

                    local newGui = script.Parent:FindFirstChild("InteractGui"):Clone()
                    newGui.Parent = player:WaitForChild("PlayerGui")

                    newGui:WaitForChild("InteractBoard").Adornee = v

                else
                    if player:WaitForChild("PlayerGui"):FindFirstChild("InteractGui") then

                        print("Got out of sight!")

                        player:WaitForChild("PlayerGui"):FindFirstChild("InteractGui"):Destroy()

                    else

                        print("Never was in sight!")

                    end
                end
            end
        end     

    end)
end)
2
Nvm scripts don't run inside replicatedStorage MattVSNNL 620 — 3y
0
~facepalm~ NickyPlayz2011 82 — 3y
0
lol NGC4637 602 — 3y
0
xDDDDD MattVSNNL 620 — 3y

Answer this question