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

Why is my script not working and not showing any output?

Asked by 9 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.

It is meant to open a curtain if a player in the group with a certain rank says a command but it cant be opened when it is already open. Nothing comes out in the output, I am the correct rank and everything but absolutely nothing happens. This is my script:

Amount = 0.1
GroupId = 1184081
GroupRank = 3

Part = script.Parent
Open = false

game.Players.PlayerAdded:connect(function(plr)
    if plr:IsInGroup(GroupId) and plr:GetRankInGroup(GroupId) >= GroupRank then
        plr.Chatted:connect(function(chat)
            if Open == false and string.lower(chat) == "Curtains, please!" then
                Open = true
                for i = 1,250 do
                    Part.CFrame = CFrame.new(Part.Position.X,Part.Position.Y,Part.Position.Z+Amount)
                    wait(.00001)
                end
            elseif Open == true and string.lower(chat) == "Thanks for watching!" then
                Open = false
                for i = 1,250 do
                    Part.CFrame = CFrame.new(Part.Position.X,Part.Position.Y,Part.Position.Z-Amount)
                    wait(.00001)
                end
            end 
        end)
    end
end)
0
Everything looks right at first glance. Place a few prints to double check variables are holding the correct values. You might just be surprised. RoboFrog 400 — 9y

Answer this question