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

This script should give you a room (Does) and change a value from false to true (Doesn't). Why?

Asked by 7 years ago

You don't have to read the whole code. It's all the same, just changes the names because it's the same for 50 different rooms.

The "----- Here -----"s were just for me to guide myself while making the script. Doesn't affect it.

Repeats this 50 times in the same script but instead of "("Room100A")" and "R100A" it says the name of the other rooms and stuff. I didn't upload the full script because I'm not allowed to go over 10k characters :)

I hope you can help me...

local player = game.Players.LocalPlayer
local room = game.ServerStorage.Room100A
local players = game.Players:children()

function onChatted(msg, recipient)
    if msg == "give"..players.."room" then
        if recipient:GetRankInGroup(2936671) >= 13 then
            local enabled = true   
            if players.Backpack:FindFirstChild(tostring("Room 100A")) == nil and enabled then
                room:clone().Parent = players.Backpack
                game.Workspace.myBoard.SurfaceGui.Rooms.R100A.Taken.Value = true
                enabled = false
            end
        end
    end 
end

player.Chatted:connect(function(msg) onChatted(msg) end)

When I use it in the script, talking about the "R100A" part, the "100" doesn't get blue, it used to when names were 100A or things like that. I changed everything to put the "R" first so that it was not taken as a number and it didn't; it doesn't at the studio.

1
you define enabled as true and then ask if it's true. it is; you just said it is. 1waffle1 2908 — 7y

Answer this question