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

Scenarios: VARIABLES ARENT GOOD ENOUGH?! :(

Asked by
Lefryn 20
9 years ago
place = { "Duel", "Training", "Bridge", "Normal", "Forest", "Mountains", "Frost", "Ruins", "Water" } -- Names of maps which need to be placed in lighting. I have "Regular" as an empty map so it just removes other scenarios 
--Also, you have to have an empty model named LightingPlacement in the workspace
--HeyWhatsHisFace/DustyTT :P
game.Players.ChildAdded:connect(function(nP)
    if  nP:IsInGroup(2537795) then --Number is group id 
        if  nP:GetRankInGroup(2537795) >= 12 then -- Number is group id then rank level
            nP.Chatted:connect(function(msg)
                for i = 1, #place do
                if string.lower(msg) == "scenario/" ..string.lower(place[i]) then -- change "scenario/" to "run/" if you want
                    x = game.Lighting:FindFirstChild(place[i]):Clone()
                    M = Instance.new("Hint")
                    M.Parent = game.Workspace
                    M.Text = "Playing: " ..place[i].. " Scenario..." 
                    p = game.Workspace.LightingPlacement:GetChildren()
                    for i = 1, #p do
                        p[i]:Destroy()
                    end
                    wait(1)
                    M.Text = place[i] .. " Scenario Loaded."
                    x.Parent = game.Workspace.LightingPlacement
                    wait(3)
                    M:Destroy()
                elseif string.lower(msg) == "scenarios" then
                    gf = Instance.new("Hint")
                    gf.Parent = game.Workspace
                    gf.Text = "Current Scenarios: " ..place[1]..", " ..place[2].. ", " ..place[3].. ", " ..place[4]
                    wait(5)
                    gf:Destroy()
                end
                end
            end)
        end
    end

^ Thats the code, group IDs are intact, and after the hint appears, it doesnt load the scenario or remove the hint, and it says the variable should be replaced with local.

And ya, this isn't my script, got it from a friend...

Also, the places are all there, and this supposedly happened after I added two more to the place list, though it couldve happened before.

Output error 1 : LightingPlacement is not a valid member of Workspace

0
Also, the variables it said had to be changed to locals were X and M Lefryn 20 — 9y
0
Use code block instead of Inline Code. Code block is the blue circles that has a word (Lua) inside of it. Paste the script in-between the Squiggly lines. "~~~~~~~~~" alphawolvess 1784 — 9y
0
Check the answer below, sorry about that, screwed up lol Lefryn 20 — 9y
0
Copy and paste the exact error alphawolvess 1784 — 9y
View all comments (3 more)
0
There is no error, however I found some info from the output I'll post in the question. Lefryn 20 — 9y
0
Also, if you'd like, I can send you the model w/ everything required. Lefryn 20 — 9y
0
You should have your friend use PlayerAdded instead of ChildAdded. alphawolvess 1784 — 9y

1 answer

Log in to vote
0
Answered by
xPolarium 1388 Moderation Voter
9 years ago

To answer the Output error 1, you don't have a model named "LightingPlacement" located in Workspace. Since you are using a script from a friend, then you probably didn't listen to his comments, as indicated on line 3: --Also, you have to have an empty model named LightingPlacement in the workspace I'm going to assume you know how to create a model, name it LightingPlacement and then put it in the workspace.

Other than that, it would be nice for you to share the model with everything since this is a bit confusing on what you're asking. All I can try to do to help is rewrite the code because this script you have is all around messy. And by messy, you should add or change the Chatted functions.

Ad

Answer this question