#Scripting Help

1 messages Ā· Page 2 of 1

grizzled ore
#

BrickColor.new doesnt allow rgb values

#

you have to do

#

Part.Color = Color3.fromRGB(x,x,x)

#

im not sure tho

merry plover
#

yes ^

modern copper
#

thank!1!

lament karma
#

how do i make this more efficient

torn spear
# lament karma how do i make this more efficient

Looks like a lot of those variables are only being used once. You also define gui = script.Parent but continue to write script.Parent multiple times. You may be able to remove some of the variables at the top depending on if you don't use them again later in the script.

local gui = script.Parent
local cams = workspace.cam
--// What is with `game = script.Parent.game`??????????

local ts = game:GetService("TweenService")
local ti1 = TweenInfo.new(3,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
local ti2 = TweenInfo.new(2,Enum.EasingStyle.Quad,Enum.EasingDirection.In)
local ti3 = TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.InOut) --// Unused?

--// Tweens
local logo1 = ts:Create(gui.ii,ti1,{Position = UDim2.new(0.112,0,0.355,0)})
local translogo1 = ts:Create(gui.iiheps,ti2,{ImageTransparency = 0})
local translogo2 = ts:Create(gui.ii,ti2,{ImageTransparency = 1})

local texttrp1 = ts:Create(gui.iitext,ti1,{TextTransparency = 0})
local texttrp2 = ts:Create(gui.game,ti1,{TextTransparency = 0})
local textdrop = ts:Create(gui.heps,ti2,{Position = UDim2.new(0.262,0,0.408,0)})

local raise = ts:Create(gui.f1,ti2,{Position = UDim2.new(0,0,-1,0)})
local lower = ts:Create(gui.f2,ti2,{Position = UDim2.new(0,0,1,0)})
lament karma
jagged lance
#

change it

sharp garden
#

Need some announcement system scripting help.
Anyone is worthy?

Script for managing announcement UI and listening a remote event.

local AnnouncementRemotes = game:GetService("ReplicatedStorage"):FindFirstChild("AnnouncementRemotes")
local RemoteEvent = AnnouncementRemotes:FindFirstChild("ChangeText")
local GUI = game:GetService("StarterGui")
local AnnouncementUI = GUI:WaitForChild("AnnouncementUI")
local MessageText = workspace["Announcement Machine"].Text
local ClickDetector = script.Parent

local function remoteEventMessage(message)
    MessageText.Value = message
end

local function UIShow()
    AnnouncementRemotes.UIShow:FireAllClients()
    script.Parent.MaxActivationDistance = 0
    wait(6)
    script.Parent.MaxActivationDistance = 32
end

local function UIText()
    AnnouncementRemotes.UIText:FireAllClients(MessageText.Value)
end

ClickDetector.MouseClick:Connect(UIShow)
ClickDetector.MouseClick:Connect(UIText)
RemoteEvent.OnServerEvent:Connect(remoteEventMessage)

Local Script for firing a remote event when the textbox property called Text is changed.

local AnnouncementRemotes = game:GetService("ReplicatedStorage"):FindFirstChild("AnnouncementRemotes")
local RemoteEvent = AnnouncementRemotes:FindFirstChild("ChangeText")

local Textbox = script.Parent

local function changeMessage()
    RemoteEvent:FireServer(Textbox.Text)
end

Textbox.FocusLost:Connect(changeMessage)

Error provided in dev. console:

lament karma
#

MessageText.Value = tostring(message)

sharp garden
#

wooohhh

#

thanks

lament karma
#

np

harsh flare
#

uh

#

whats the code thing

#

if breakerList[v.Name] == true then
                    
                    
                    
                    breakerList[v.Name] = false
                    print(breakerList)
                    script.Parent[v.Name].TextButton.BackgroundColor = BrickColor.new(255,0,0)
                else
                    
                    
                    breakerList[v.Name] = true
                    print(breakerList)
                    script.Parent[v.Name].TextButton.BackgroundColor =BrickColor.new(0,255,0)

                end
#

ok

#

so this is adding a new database entry

#

*dictonary

#

it looks like this rn

#
[1] = false
[2] = false
[3] = false

#

and when i try to edit one with the name of v

#

it adds one as

#

["1"]

#

v's name is 1

#

could someone help me fix this

grizzled ore
#

my guess is

harsh flare
#

Mhm

grizzled ore
#

since v's name is a string and not a number it thinks "1" and 1 arent the same thing(they arent)

#

try using tonumber(v.Name) wherever youre trying to edit instead of v.Name

harsh flare
#

Ok let's try editing rhet

#

ok it works

#

thanks

grizzled ore
#

np Catthumbsup

harsh flare
#

now the minigame thing is close to being finished

wary thorn
#

You can also do

#
`{variable}`
#

To make it a string

grizzled ore
#

(we had to make it a number though)

sour orchid
#

"hi" .. variable .. "hi"

harsh flare
lament karma
#

like if qsp was your variable it would print "hi qsp hi"

wary thorn
#

OH

#

brain failed

#

yeah

#

I thought it said tostring()

#

so good at this fr

harsh flare
wary thorn
#

I thought it said tostring() 😭

harsh flare
lament karma
#

for example

#
variable = "FUCK"

print("fat" .. variable .. "OMG")```
#

this will print "fat FUCK OMG

#

or if u want to add space

#
variable = "FUCK"

print("fat " .. variable .. " OMG")```
wary thorn
#

works with converting numbers to string too

torn spear
#

Doing {var} instead of .. var .. helps with readability and makes it easier to spot missed spaces.

#

Not sure if there's a performance difference between the two.

lament karma
#

no

fallen meadow
#

string.format is better..

wary thorn
#

explode

sour orchid
#

KILL

torn spear
#

Slaughter.

fallen meadow
#

no.

sharp garden
#

yes.

hearty island
#

it literally does the same thing

#

but just with more code

lament karma
#
task.spawn(function()
        for _, part in cams do
            if part:IsA("BasePart") then
                cam.CFrame = part.CFrame
                wait(5)
            end
        end
end)```
#

how tf do i loop this again

maiden dew
lament karma
#

until a button is pressed

#

which i will implement sometime later

maiden dew
#

I see

#
local LoopThing = task.spawn(function()
  while true do
    for _, part in cams do
      -- ...
    end
  end
end)

wherever.Button.ClickDetector.MouseClick:Connect(function()
  task.cancel(LoopThing)
end)
#

Really the only thing you need around the for loop is a while true do loop @lament karma

lament karma
#

ok

#

ok thank you

#

now it's just iterating through only two cams

#

wtf

lament karma
#

ok

#

is roblox high???

#

now it's not even changing the camera

#

no errors no prints nothing

#

i swear roblox is on some sort of crack

#

on my test game it works as intended but on the main game it only iterates through 2 parts

hearty island
#

send code

#

@lament karma

sharp garden
hearty island
#

it exists

#

though i use coroutines instead

wary thorn
#

task library šŸ’Ŗ

lament karma
lethal hull
lament karma
#

local cams = game.Workspace:WaitForChild("cam")

modern copper
#

so, I know game:IsLoaded returns true only on the first time the game is loaded, but how do I get it to return true if the game is reloaded?

#

(after

for _, obj in workspace:GetChildren() do
    if obj.ClassName ~= "Terrain" and not Players:GetPlayerFromCharacter(obj) then
        obj:Destroy()
        RunService.Stepped:Wait()
    end
end

)

#

or rather this

local new = ServerStorage.MapBackup:Clone()
for _, obj in new:GetChildren() do
    obj.Parent = workspace
    if obj:IsA("Model") then
        obj:MakeJoints()
    end
end
new:Destroy()
hearty island
#

yeah no game.isloaded works independently of whatever you're doing

#

you need a custom event/value for tracking map loads

grizzled ore
#

what does runservice do?

lament karma
hearty island
#

eg can tell if a game is running on studio or a game

#

eg can provide events that fire on render updates

#

i cant think atm so yea thats all you get from me

modern copper
grizzled ore
#

if i have a temp value i want to access in multiple scripts how hsould i do that

#

should i just use an intvalue or is there something better

modern copper
tribal timber
torn spear
#

^

hearty island
#

if it's just one value i tend to just use numbervalues for example

#

has a changed event with it too

hearty island
#

i usually code things like that in "threads" (it doesn't really count as an actual thread probably but similar concept)

modern copper
#

Soo

hearty island
#

šŸ¤”

modern copper
modern copper
#

Also

#

In another context i did script.enabled = false

#

And then later

#

Script.enabled = true

#

But that didnt work entirely

modern copper
hearty island
#

as with your new script, if you could send it that'd be good

#

for me to even understand what is going on

modern copper
#

What is not working

#

I can give u the script tmr

hearty island
#

ok do tha

sharp garden
#
script:WaitForParentWhichIsA("Model")
modern copper
modern copper
# hearty island ok do tha
local random = math.random(0,100)
local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local ServerStorage = game:GetService("ServerStorage")
local pro = NRC.ControlRoom.Buttons:WaitForChild("SafeguardProtection")
local speakers = game.Workspace.Speakers
    
clickDetector.MouseClick:Connect(function (player)
    print(random)
    NRC.ControlRoom.ScreenPanel2.Temo.Enabled = false
    NRC.ControlRoom.ScreenPanel2.L.SurfaceGui.TextLabel.Text = "-System Unavailable-"
    task.wait(30)
    if random >= 50 then
        NRC.ControlRoom.ScreenPanel2.Temo.Enabled = false
        NRC.ControlRoom.ScreenPanel2.L.SurfaceGui.TextLabel.Text = ("-Shutdown Success-")
    elseif random <= 49  then
    NRC.ControlRoom.ScreenPanel2.Temo.Enabled = true
    end
end)

So I basically took out the non essential stuff

#

Temo is the temperature script what does the temp = temp + 10, and I basically need it to stop for an amount of time, and continue it if random is < 49

lament karma
#

temo

lament karma
#

what is going on

#

why is it doing this

#

ok now its doing this

#
task.spawn(function()
function dothestuff()
        task.spawn(function()
            local textBounds = text.TextBounds
            local lineHeight = textBounds.Y
            local frameHeight = frame.Size.Y.Offset
            local numLines = math.ceil(textBounds.Y / text.TextSize.Y)
        if numLines > frame.Size.Y.Offset then
            repeat
            frame.Size = UDim2.new(frame.Size.X.Scale, frame.Size.X.Offset, 0, lineHeight * numLines)
            wait()
            until numLines < frame.Size.Y.Offset
        end
        end)
end
end)```
#

this is the code that calculates frame size

tribal timber
#

use automaticsize

lament karma
#

oh my fucking god

#

ok nevermind it still no worky

#

game sucks

grizzled ore
#

what is wrong

lament karma
#

hodl on

tribal timber
#

automaticsize only works with offset

grizzled ore
#

tbh i feel like i could script very well

#

only if i knew how roblox studio worked in general

lament karma
#

automaticsize doesn't work

#

but the dothestuff one does

tribal timber
#

shit is peak

#

i suggest using it instead because ui is meant to be in offset

#

then if you just want to size the ui depending on the screen resolution

#

you can use the UIScale instance

lament karma
#

but automaticsize refuses to work

#

for some unknown raeson

tribal timber
#

are you using scale or offset

lament karma
#

offset

tribal timber
#

are you applying the automatic size to the black frame or the text

lament karma
#

the frame

tribal timber
#

damn

#

thats weird

#

do you have any leftover aspectratio constraints?

lament karma
#

not in the dialog system no

tribal timber
#

i could send you a file that has automatic size if that could help

lament karma
#

i think roblox is just on crack

tribal timber
#

oh yeah the text has to have automatic size too, if you already dont have that

lament karma
#

breh

#

maybe thats my problem

tribal timber
lament karma
#

ok i did not set that correctly

#

should be y not xy

tribal timber
#

yes

lament karma
#

how do i fix the clipping

tribal timber
#

set the text position to 0 and use uipadding instead

#

uipadding being inside of the frame

#

(and using offset on the uipadding)

modern copper
#

U said something with a 2nd script that needs to listen

#

Or smth

wary thorn
#

šŸ™

hearty island
#

have roblox rate limits been loosened as of recently?

#

booted up a few of my old bots to mess with and they hardly encounter rate limits as much as they used to

#

one of them did a few thousand post requests within a few minutes with 0 rate limits

tribal timber
#

not that I know of

#

weird

hearty island
#

strange

hearty island
#

also just noticed that i sent it here, not tech channel

#

apologies lol

surreal basin
#

Ladies and gentlemen of QSERF's scripting help! I need some help making a script for a jukebox. I can give information if you DM me, I cannot pay if that's what you want for this script. Thank you in advance.

lament karma
#

the iitpp subtitle system is open sourced??

wary thorn
#

yeah

#

most of their stuff is

#

works well

lament karma
#

well ermmm

#

nuh uh i refuse to use āŒ

sharp garden
#

Very hard script which represents a flashlight. I was stuck with stopAnim() and unEquip() function problem. These functions are supposed to stop the animation and turn off the flashlight. Is there anything to access to a character when the tool is in backpack? (P.S: hard to resolve in my opinion.)

local Tool = script.Parent.Parent
local Handle = script.Parent

toggle = false
debounce = true

local function On()
    if debounce == true then
        debounce = false
        Handle.Light.Color = Color3.fromRGB(108, 139, 206)
        Handle.Light.SpotLight.Enabled = true
        Handle["Flashlight On"]:Play()
        wait(1)
        debounce = true
    end
end

local function Off()
    if debounce == true then
        debounce = false
        Handle.Light.Color = Color3.fromRGB(0, 0, 0)
        Handle.Light.SpotLight.Enabled = false
        Handle["Flashlight Off"]:Play()
        wait(1)
        debounce = true
    end
end

local function stopAnim()
    if Tool.Parent:IsA("Backpack") then
        local player = Tool.Parent.Parent
        local character = player.Character
        local humanoid = character:FindFirstChildWhichIsA("Humanoid")

        local anim = humanoid:LoadAnimation(script.Holding)
        anim:Stop()
    else
        stopAnim()
    end
end

local function onEquip()
    local character = Tool.Parent
    local humanoid = character:FindFirstChildWhichIsA("Humanoid")

    local anim = humanoid:LoadAnimation(script.Holding)
    anim:Play()
end

local function unEquip()
    Off()
    toggle = false
    stopAnim()
end

Tool.Activated:Connect(function()
    if toggle == false then
        On()
        toggle = true
    else
        Off()
        toggle = false
    end
end)

Handle.Parent.Equipped:Connect(onEquip)
Handle.Parent.Unequipped:Connect(unEquip)
lament karma
sharp garden
tribal timber
#

you must use :stop() on the same animation track

#

as of right now, you are doing humanoid*:LoadAnimation()*:Stop()

#

whoch means you are creating a new animation track, and stopping this newly created one

#

not the first one

sharp garden
#

oh

#

maybe i should revamp onEquip() function

#

Your resolve was successful

lament karma
#

script

grizzled ore
#

isnt this scripting help not scripting contract someone to write stuff for you

#

idk

modern copper
# hearty island dont really get it

Ok, ignore that for now, bc I still need help on something else, being that I have a script what does temp = temp + 10, and after I reload the map from Serverstorage, the temp hasnt reset

grizzled ore
#

ok quick question

#

if i have a modulescript with values

#

and in one script i do require(modulescript).ExampleValue = 8

#

can i read that 8 in another script

fallen meadow
grizzled ore
#

nice

#

time to revamp all my values into one script steamsuffer

modern copper
#

wait

#

does that mena

#

wait nvm

tribal timber
surreal basin
sharp garden
#

What the fuck. Why it doesnt work???

-- LocalScript
-- Parent: ReplicatedFirst

local Players = game:WaitForChild("Players")
local LocalPlayer = Players.LocalPlayer
local PlayerGui = LocalPlayer:WaitForChild("PlayerGui")

PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat, false)
sharp garden
#

yeah

#

do i have to show it?

#

just copy this code and paste it on the localscript

#

it has to be parented to ReplicatedFirst

lament karma
sharp garden
#

oh

#

then i`ll have to make an image

#

it will take approximately...

#

1 min

sharp garden
lament karma
#

imgage

#

ok

lament karma
sharp garden
#

o h

lament karma
#

ARGHHHHH

#

WHY DOES ROBLOX KEEP BREAKING MY SCRIPTS

#

I HATE ROBLOX

grizzled ore
#

skill issue smh

#

(Jk)

grizzled ore
#

it didnt load for me and i dont think i want it to

oblique dagger
#

I only talk qbout fish eveyrdya wtf

grizzled ore
#

LMFAO LOLL

sharp garden
#

why

server script

local ServerStorage = game:GetService("ServerStorage")
local UserIDList = require(script:FindFirstChildWhichIsA("ModuleScript"))

local Player = game.Players:GetPlayerFromCharacter(script.Parent)
local HumanoidRootPart = script.Parent:FindFirstChild("HumanoidRootPart")

for _, UserID in ipairs(UserIDList) do
    if Player.UserId == userID then
        local ClonedParticle = ServerStorage.ParticleStorage.AdminParticle:Clone()
        ClonedParticle.Parent = HumanoidRootPart
        break
    end
end

module script (inside server script)

local IDList = {
    "4362738489"
}

return IDList
sour orchid
#

why what

sharp garden
# sour orchid why what

why wont this script work with module script. it tries to identify the user id but fails to do so.

sour orchid
#

where is it failing at

sharp garden
#

server script

lament karma
#

and not IDList

sharp garden
#

oh

lament karma
modern copper
#

how do I fix that?

#
game.Workspace.Trahs:WaitForChild("RCTP").Position = Vector3.new(61.955, 321.72, 47.361)
grizzled ore
#

ok so that means it will wait forever for RCTP

#

Make sure it actualy exists and the path is rght

wind gulch
#

local door = script.Parent

function OpenDoor(x,y)
for i =1,45 do
local pos = door:GetBoundingBox()
pos.Position += Vector3.new(0,0,1)

end
print("test complete")
return

end

OpenDoor()

#

help

lament karma
wind gulch
#

i made new code and i am using union as primary part: local door = script.Parent

function OpenDoor()
if door and door.PrimaryPart then
local zOffset = 10 -- Adjust the Y-axis offset as needed
local currentCFrame = door.PrimaryPart.CFrame
local newPosition = currentCFrame.Position + Vector3.new(0, 0, zOffset)
door:SetPrimaryPartCFrame(CFrame.new(newPosition))
print("Door moved successfully!")
else
warn("Door or PrimaryPart not found.")
end
end

OpenDoor()

wind gulch
# lament karma what wrong

i made new code and i am using union as primary part: local door = script.Parent

function OpenDoor()
if door and door.PrimaryPart then
local zOffset = 10 -- Adjust the Y-axis offset as needed
local currentCFrame = door.PrimaryPart.CFrame
local newPosition = currentCFrame.Position + Vector3.new(0, 0, zOffset)
door:SetPrimaryPartCFrame(CFrame.new(newPosition))
print("Door moved successfully!")
else
warn("Door or PrimaryPart not found.")
end
end

OpenDoor() its saying the primary part is not there

lament karma
#

roblox is assuming the object is a model

#

which means u have to model it

#

go to the explorer, select your model and select the primary part option

#

once there u can set the primary part to whateve

wind gulch
#

when I did that it made my model go in the wrong diection

lament karma
#

that's chat gpt code zoinkrs

#

make sure that you set the axisproperly

hearty island
#

adjust your vector calculation for a different axis

jagged lance
#

hello guys i need help

#
local reverse = false

local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(0.25, Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,true,0)

local gloves = {}
for i,v in script.Parent:GetChildren() do
    if v.Name == "Glove" then
        table.insert(gloves,v)
    end
end

while true do
    local foundglove = false
    local selectedglove = nil
    while foundglove ~= true do
        selectedglove = gloves[math.random(1,#gloves)]
        if selectedglove.Moving.Value == false then
            foundglove = true
        else
            print("no")
        end
    end
    selectedglove.Moving.Value = true
    print("the j")
    local properties = {Position = selectedglove.Position}
    if reverse == false then
        properties.Position += Vector3.new(0,0,2)
    else
        properties.Position += Vector3.new(0,0,-2)
    end
    local tween = tweenservice:Create(selectedglove,tweeninfo,properties)
    tween:Play()
    task.wait(0.25)
    tween:Destroy()
    selectedglove.Moving.Value = false
end```
#

this is the whole thing but

#

the error i have is that the while loop is not repeating

hearty island
jagged lance
#

whats a coroutine again?

hearty island
#

async basically

fiery ivy
#

are u sure the script isnt disabled

jagged lance
#

oh shit

#

no its not

#

crap how do i do that

jagged lance
harsh flare
#

so if you put a print statment at the very top it doesent print twice?

jagged lance
#

ill show u what it does

harsh flare
#

no errors?

#

no nothing?

jagged lance
#

no errors

#

but its not doing what its meant to

hearty island
#

maybe something is yielding forever idk

jagged lance
#

so this is my punchy wall yes

#

and the fists will come out and punch people

hearty island
#

where is the script placed

jagged lance
#

the issue is that over time the tweens are running twice

#

oh shit

#

i think i see problem

fiery ivy
jagged lance
#

ok

#

this error is really hard to spot

#

but i found it

hearty island
#

Uh

#

tween:Destroy()

#

i dont htink this is a thing

jagged lance
#

not that

jagged lance
#

it deletes the instance

hearty island
#

even tweens?

jagged lance
#

yes

#

tweens are instances

fiery ivy
hearty island
#

ok im retarded

jagged lance
#

anyway heres the problem

#

tweens are 0.25 seconds long

hearty island
#

I think if you destroy it

#

it wont finish

jagged lance
#

and they are reversed with no delay so its 0.5 seconds in total

hearty island
#

and will revert

fiery ivy
#

what i do is wait for tween completed and then destroy it idk if that would help

jagged lance
#

but anyway the problem is

hearty island
#

yes

jagged lance
#

yeah it needs to run async

#

how do i do that?

hearty island
#

because destroying the tween at the exact same duration from it running can cause micro delays

#

which fucks things up

fiery ivy
#

coroutine.wrap(function()
--ur existing code
end)()

jagged lance
fiery ivy
#

pretty sure

jagged lance
#

just tell me

fiery ivy
#

or alternatively task.spawn both work

jagged lance
#

yes

#

i'll just task.spawn

fiery ivy
#

1s

hearty island
#

noo

#

just in case

#

do a tiny check to wait until tween has finished before destroying

jagged lance
#

yeah i'll do that

#

actually no i wont need to

#

task.wait is bound by server fps

#

so even if the server lags it'll stay in time

hearty island
#

nah its just to reduce chance of conflict because a tween might run for a few milliseconds after you do :Destroy()

i had this bug a few years ago

jagged lance
#
local reverse = false

local tweenservice = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(0.25, Enum.EasingStyle.Linear,Enum.EasingDirection.InOut,0,true,0)

local gloves = {}
for i,v in script.Parent:GetChildren() do
    if v.Name == "Glove" then
        table.insert(gloves,v)
    end
end

local function thingy()
    local foundglove = false
    local selectedglove = nil
    while foundglove ~= true do
        selectedglove = gloves[math.random(1,#gloves)]
        if selectedglove.Moving.Value == false then
            foundglove = true
        else
            print("no")
        end
    end
    selectedglove.Moving.Value = true
    print("the j")
    local properties = {Position = selectedglove.Position}
    if reverse == false then
        properties.Position += Vector3.new(0,0,2)
    else
        properties.Position += Vector3.new(0,0,-2)
    end
    local tween = tweenservice:Create(selectedglove,tweeninfo,properties)
    tween:Play()
    task.wait(0.5)
    tween:Destroy()
    selectedglove.Moving.Value = false
end

while task.wait(0.25) do
    task.spawn(thingy)
end```
hearty island
#

Ok now

jagged lance
#

this is for a minigame game right

hearty island
#

Now you won't need to

#

Since 0.5 delay

jagged lance
#

its only gonna be running for like

#

10 seconds

#

before the whole thing is deleted

hearty island
#

Ok

jagged lance
#

it fuckin works

#

yaaaaas

jagged lance
#

@odd chasm get in here right

tribal timber
jagged lance
#

so i have an issue i dont know how to approach

#

ok

#

so i want to pick a random number

#

and run a different function based on that number

#

the question is

#

how do i make it futureproof so i can add like 50 different conditions

#

without making spaghetti

odd chasm
jagged lance
#

read

tribal timber
odd chasm
#

idk just do

function functionidklol()
print("yea")
end

local table = {
[1] = functionidklol,
}

#

then do like table1 with ur random number

jagged lance
#

would that work?

odd chasm
#

yes

jagged lance
#

it doesnt work

#

you lied!!

#

i did it correctly

#

and fixed it

#

loser

#

this is how you do it

#

:3

jagged lance
#

ok nevermind!

#

it isnt!

#

nevernevermind

#

already fixed

jagged lance
#
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(model)
        model.Humanoid.Died:Connect(function()
            ExternalInteraction.RemoveCompletion(plr)
            DataHandler:Set(plr,"Streak",0)
        end)
    end)
end)
#

why this no work

#

nvm

#

i see problem

odd chasm
#

since you join so quick after the server started or something

#

and doesnt fire properly

jagged lance
#

yeah no

#

i found the problem

#

i had a task.wait at the start of the script

tribal timber
#

the for _, Player in game.Players:GetPlayers() do task.defer(OnPlayer, Player) end in question

odd chasm
#

coroutine > task.spawn

tribal timber
#

i call cap

odd chasm
tribal timber
#

yes

jagged lance
#

why the FUCK can i not mute the roblox death sound

jagged lance
#

for some reason

#

the sound cant be edited with a script

#

idk why

#

you cant remove it, that breaks it

#

you cant edit it, that doesnt work

#

what do i dooooo

#

😭

odd chasm
#

set volume to 0 by local script

grizzled ore
#

not sure if this is the right place but

#

how do i get bro to hold it the other way

#

like vertically

jagged lance
jagged lance
#

doesnt work

odd chasm
grizzled ore
#

so properties on the tool not the handle

wary thorn
#

Yeah

#

There is a plugin to help by maximumadhd I think

sour orchid
#

ToolGripEditor

grizzled ore
#

guys plz donate

#

am i insane or did this use to be 5 robux

harsh flare
flat crow
#

I thought that was free

fallen meadow
#

theres a free version

tribal timber
#

the piracy in question

grizzled ore
#

Included in the package:
Tool Grip Editor
20 Viruses

tribal timber
#

you must support the pirate in someway right

#

in this case, it is with your entire computer

fallen meadow
tribal timber
#

yet

jagged lance
#

back in the old day

#

plugins were all free

#

but then the moon animator maker person said they spent a shit ton of time on the plugin and made no money

#

other plugin developers responded by making their plugins cost money

tribal timber
#

trolley now you'll only be able to sell plugins for usd

#

and if you are 18+

fallen meadow
jagged lance
fallen meadow
#

but its free and comes with a shitload of features

#

did i mention for free

jagged lance
#

and also exporting and importing is a pain in the ass

harsh flare
#

BlenderšŸ™

jagged lance
#

i still don't know how to make roblox animations with blender

fallen meadow
#

my point was that its dumb to say 'i made roblox animation editor but with themes and made it look like a fucking windows application for some reason' when shit like blender exists

#

plugins shouldnt be paid šŸ—£ļø

tribal timber
#

what

#

yes they should

#

effort should pay off

grizzled ore
#

thats like

#

remove robux

#

because

#

doesnt matter if you spent months making a game look heres a free version on freegamesnovirustrust.gimmeallurmoney gun_you.com

#

you cant make money from it

#

no gamepasses

fallen meadow
grizzled ore
#

Zthat part was a joke but the point stands

#

if a game has lets say a raider team for free does this mean qs shouldnt be allowed to monetize the raider access

fallen meadow
grizzled ore
#

its an example

#

blender exists as a free version of those plugins and ur saying they shouldnt be paid
if a game with a raider system existed as a free version of qserf, should the raider pass not be paid

#

also

#

if the free stuff exists go use it no ones stopping you

#

thats like oh no winrar is paid boo 7 zip exists it shouldnt be paid

#

go use 7 zip them

fallen meadow
#

also a lot of the paid plugins are qol. why the fuck does a plugin that appends rbxassetid:// to a number cost money

#

my main reason for not liking paid plugins is because it discourages new developers from doing stuff

theres also blatant scams like that one baseplate improver that costs 14 fucking dollars?

also moon animator adding paid themes is just stupid

grizzled ore
grizzled ore
#

Let them make their money

fallen meadow
#

the point of plugins is to save time, not diy
imji should not cost money

grizzled ore
#

plugins dont grow on trees, someone spent their time for those and if you want your time saved, you have to pay

#

i just realized we are super off topic so i am moving on

harsh flare
#

I think it's fair for plugins to cost money, please just don't jack it up to thousands

tribal timber
#

5000 robux equals to $17 for reference

wind gulch
#

yall I need help

#

i want to make a debounce for my door so players cannot interact with the button instantly

#

in simpler words, a player might click the button too much and the door will be very far from the frame

#

help

sour orchid
#

you can make soemthing like this with a variable

#
local debounce = false
clickDetector.MouseClick:Connect(function()
  if debounce then 
    return 
  end
  debounce = true

  --open the door rahhh

  task.wait(0.5)
  debounce = false
end)
flat crow
#

I need help here

I'm writing a program for my parent's company that manages datasets that contains addresses, and I've been doing well on my own so far but I'm struggling to find a solution to this one specific problem. Here's the entire code, it is python3 v3.10.12, it's too big to post with the thing that gives you the color thingamajig so it'll be a text file

at the point where I commented "HERE IS WHERE I NEED HELP" is where I'm trying to add a feature that will take the data from a row that has missing data in a speified column and bring it into a new dataframe, and then remove it into the new one (I'm using pandas). I was able to figure out how to purge the data but I can't figure out how to make a new dataframe out of it first.

jagged lance
#

stil lnot answered

#

im too tired to do this

#

but if its not answered by tommorow i'll look through it

flat crow
#

Please don’t feel obligated to

#

If you do though show me how you researched

#

Cause I’m bad at reading documentation

fallen meadow
jagged lance
#

i dont have much experience with python working with stuff like spreadsheets

flat crow
#

basically the logic is: if response == purgelast then remove rows with missing last name information, but before doing that I want it to move that data to a new dataframe

#
                print('What to adjust?')
                print('Purge rows with missing data in the first name field and move them to a seperate dataset for repair (purgefirst)')
                print('Purge rows with missing data in the last name field and move them to a seperate dataset for repair (purgelast)')
                print('Purge rows with missing street number and move them to a seperate dataset for repair (purgenumber)')
                print('Purge rows with missing street name and move them to a seperate dataset for repair (purgestreet)')
                print('Purge rows with missing city information and move them to a seperate dataset for repair (purgecity)')
                print('Purge rows with missing state information and move them to a seperate dataset for repair (purgestate)')
                print('Purge rows with a missing zip code and move them to a seperate dataset for repair(purgezip)')
                print('\n')
                print('To run of the any above commands without moving them to a seperate dataset (fully deleting them) add "m" before the command.')
                print('PLEASE NOTE: These changes are LOCAL and will not be saved unless you append the clean dataset to the database, or export. The dataset containing purged information cannot be appended but can be exported.')
                print('To get more specific options such as modify a specific cell, go back to the menu after you imported the data by typing "back", and select adjust.')

                choice = input('>>>')
                if choice == 'purgelast':
                    df.dropna(subset=['OWNR_LAST1'], inplace=True)
                    print('Data purged.')
                    afterDataImported()
fiery ivy
#

Hello

#

Can someone explain how to code door

#

Pls

#

Guys?

#

Oops

#

Whaat

#

Dude I ain’t no scammer with

#

WTH

#

DUDE

#

CAN SOMEONE HELP ME

#

omg are you kidding me

#

Great I’m on my own

modern copper
#

Sir

#

It might take a while for sm1 to respond

jagged lance
#

spoiler: he never found out how to make his door

rest in peace šŸ™

wind gulch
#

how do you scale your gui so it fits on all screens???

#

help pls/

wary thorn
#

You have no idea how hard it is to explain UI scaling

torn spear
#

The barebones basics (scale vs offset) are pretty simple, but things get wild real quick after that.

jagged lance
#

but you can probably find a solution on a yt video

#

or devforum

#

or the docs

sour orchid
#

also look up how to use the UI constraints

#

so that your UI looks the same on any screen

jagged lance
#

because ui is probably the most confusing thing out there

#

with so many exceptions it feels like learning english all over again

sour orchid
jagged lance
#

ui scaling is

#

very very very very stupid

#

sometimes it works and sometimes it doesn't

#

it changes from device to device

sour orchid
#

it works if you do it right

modern copper
#

ok so I have a question

#

I currently have a core temperature scriüt

#

and also one, that destroys the entire workspace and reloads it

#

and currently, when I relaod it, the temperature is the same as it has been before it reloaded

#

(not what I want)

#

but if I were to make the temp a number value

#

so that local temp = 500 is gonna change to local temp = game.workspace.temp

#

would that fox the issue?

jagged lance
#

You'd need to put the entire map into replicatedstorage and then clone it into the workspace

#

So after you destroy the map the new one is cloned in

modern copper
#

works perfectly

#

however I have a small problem

#

as the script also respawns everyone

#

somehow the team only items brake

#

I tried to reset my character but it still didnt work

#

(I made them team only items, just by moving them in the team, so idk if that is the issue)

wary thorn
#

In addition properties being set back to how they were on load

wary thorn
#

Based off of an export of all instance properties

jagged lance
#

nah dont use remote events for that

wary thorn
#

Well I mean like

jagged lance
#

remote events are just for client <> server activity

wary thorn
#

Binds led

#

What

jagged lance
#

use bindable events

wary thorn
#

Auto correct

#

I say remote events for events

#

too many

jagged lance
#

yeah

#

remote events are only for client <> server

wary thorn
#

Yes I know

jagged lance
#

bindable events are for client > client or server > server

wary thorn
#

I just am used to saying remote events for any type of event

#

instead of the name

#

Since I have had to work with them more

#

I did mean bindable functions and events

jagged lance
#

remote events

#

are a pain to work with

modern copper
#

Guys

#

I do have the map reload script already

modern copper
jagged lance
#

uh

#

what are you using

#

for ur thing

modern copper
jagged lance
#

the code

#

whats ur code

modern copper
#

ah

#

wait 1 sec

#

@jagged lance


            local Players = game:GetService("Players")
            local RunService = game:GetService("RunService")
            local ServerStorage = game:GetService("ServerStorage")

            for _, obj in workspace:GetChildren() do
                if obj.ClassName ~= "Terrain" and not Players:GetPlayerFromCharacter(obj) then
                    obj:Destroy()
                    RunService.Stepped:Wait()
                end
            end

            local new = ServerStorage.MapBackup:Clone()
            for _, obj in new:GetChildren() do
                obj.Parent = workspace
                if obj:IsA("Model") then
                    obj:MakeJoints()
                end
            end
            new:Destroy()

            for _, player in Players:GetPlayers() do
                player:LoadCharacter()
            end
wary thorn
sour orchid
#

:3

modern copper
# modern copper however I have a small problem

I forgor I had this script to do it

function teamFromColor(color) 
for _,t in pairs(game:GetService("Teams"):GetChildren()) do 
if t.TeamColor==color then return t end 
end 
return nil 
end 

function onSpawned(plr) 
local tools = teamFromColor(plr.TeamColor):GetChildren() 
for _,c in pairs(tools) do 
c:Clone().Parent = plr.Backpack 
end 
end 

function onChanged(prop,plr) 
if prop=="Character" then 
onSpawned(plr) 
end 
end 

function onAdded(plr) 
plr.Changed:connect(function(prop) 
onChanged(prop,plr) 
end) 
end 

game.Players.PlayerAdded:connect(onAdded)
#

and I see the problem I think

#

someone helpdogebegging

odd chasm
#

I think I know the problem

#

I'll be back in 20 mins

modern copper
odd chasm
#

currently on mobile

modern copper
#

I have a script that reloads the entire map

modern copper
modern copper
jagged lance
#

classic taffo falling asleep

#

lemme take a look

jagged lance
#

i think i see the problem

#

ima just rewrite the entire script

#
function teamFromColor(color) 
    for _,t in pairs(game:GetService("Teams"):GetChildren()) do 
        if t.TeamColor==color then return t end 
    end 
    return nil 
end 

game.Players.PlayerAdded:connect(function(plr)
    plr.CharacterAdded:Connect(function()
        local tools = teamFromColor(plr.TeamColor):GetChildren() 
        for _,c in pairs(tools) do 
            c:Clone().Parent = plr.Backpack 
        end 
    end)
end)```
#

@modern copper try this

modern copper
odd chasm
#

in studio test mode, playeradded and characteradded don't always like to work properly

modern copper
modern copper
odd chasm
#

ok ill have to check later

#

got stuff to do

modern copper
#

I mean when I playtest

#

It doesnt

odd chasm
modern copper
#

I mean, it says PlayerAdded

#

Abd that is

#

When someone joins

#

However

#

Due to the facility reload

#

This script will also reload

odd chasm
#

Strange lol

#

Not sure how your other scripts are setup

modern copper
#

Maybe it would help if id move it to serverscriptservice

#

As I had it in Workspace the entire tome

jagged lance
#

Move it to serverscriptservice

modern copper
#

ok so now that this is fixed, I kinda need smth to re activate my loading screen

#

wait nvm

lament karma
#

Is there a way to locally change materials for a low performance mode

#

Nvm

lament karma
#

for some reason the light just stays on

oblique dagger
#

my method is to put print into stuff

#

to see if that line works

#

I dont know about others but thats works for me when something doesnt work as intended

odd chasm
#

i cant fucking read hold on

odd chasm
#

it expects an exact value of 8.22 to finish, as well as 0. how would it be able to reach that number if it is only moving in steps of 0.1?

#

use either >= and <= to account for this

#

it will just continue forever since it will never hit 8.22

lament karma
odd chasm
#

i wouldnt

#

just use >= and such

#

better yet use tweens

compact wigeon
modern copper
#

Any Ideas why this doesnt work?

local player = game.Players.LocalPlayer
local PlayerName = player.Name
local KC = script.Parent
local random = Random(1274, 5930)


while true do
    KC.Pname.SurfaceGui.TextLabel.Text = "Name:".. PlayerName

    KC.Rank.SurfaceGui.TextLabel.Text = "Rank:".. player:GetRoleInGroup(6406715)

    KC.Code.SurfaceGui.TextLabel.Text = "Security Code:".. random
end
#

(Admin = Keycard)

#

temp name

fallen meadow
modern copper
#

as they have a different path

#

Rank.SurfaceGui.Textlaber

#

Pname.SurfaceGui.Textlabel

#

it at least wasnt a problem for the last months shrug

grizzled ore
#

does it give an error

modern copper
#

no

#

however

#

I just made a part

#

surface gui

#

textalber

#

and a local script saying script.Parent.SurfaceGui.Textlabel.Text = "A"

#

and it didnt work

grizzled ore
#

i dont think

#

local scripts run in the workspace

fallen meadow
fallen meadow
modern copper
#

but how do I get localplayer in a normal script

modern copper
#

ah

#

but I need a primary fix

#

I meant permanent skull_spin

modern copper
#

ok I figured it our

#

also doesnt work

wary thorn
fallen meadow
# modern copper I meant permanent <a:skull_spin:1209824359771017256>

try uh

local KC = script.Parent
local player = game.Players:GetPlayerFromCharacter(KC.Parent)
local PlayerName = player.Name
local random = Random(1274, 5930)

KC.Pname.SurfaceGui.TextLabel.Text = "Name:".. PlayerName
KC.Rank.SurfaceGui.TextLabel.Text = "Rank:".. player:GetRoleInGroup(6406715)
KC.Code.SurfaceGui.TextLabel.Text = "Security Code:".. random
#

and make it a normal script

modern copper
#

ok

modern copper
modern copper
fallen meadow
#

i mean a serverside script not a client script

modern copper
#

still no

lament karma
#

and use math.random

modern copper
#

Ok uh

#

Ill try that

#

But does that fix the text just vanishing?

#

Like all the texts

lament karma
#

wdym vanish

grizzled ore
#

where is this uh tool located

modern copper
#

Except the name, but thats just the non edited name

modern copper
grizzled ore
#

put it in the starterwhatever thing that puts tools into your backpack maybe

#

as a test

lament karma
#

ranodm should be:

local rand = math.random(1274, 5930)```
#

and to print it you have to use

tostring(rand)```
#

since rand is a number value and not a string value

modern copper
#

Ok

#

I will change it

grizzled ore
lament karma
modern copper
#

The problem is the textlabel.text =

#

I think

lament karma
modern copper
lament karma
#

can you send a ss of the explorer

#

including where the guis are located

modern copper
modern copper
#

Pname

#

And Rank

#

But u can only see code in that ss

lament karma
#

your problem is that it gets stuck at random im pretty sure

lament karma
#

since it thinks it's a string because there is no math.random

modern copper
#

Ok ok

grizzled ore
#

did the random thing work

modern copper
#

Ill try that once I can access my pc

modern copper
grizzled ore
#

ok so the Random object is a thing

#

but i dont think thats how you use it

#

i think youd have to something like

#

random.new

#

idk

#

just use math.random

modern copper
#

didnt work

#

Wait

#

it finally showed an error

modern copper
#

alright sp

#

tried a few more things

#

still fucking broken

wary thorn
#

@modern copper put

#

task.wait()

#

At line 1 and push everything down

#

If that works I swear to god

grizzled ore
#

we love it when scripts run before the shit theyre referring to loads
good

sour orchid
#

No like he has a while true do but it doesn’t have a task.wait()

wary thorn
#

What

#

He changed it

#

Read up

sour orchid
#

Huh

#

O

grizzled ore
#

wher

sour orchid
#

Sure i guess just wait

#

repeait task.wait until player lol

wary thorn
#

Just add task.wait() at the top

#

There is a chance it will fix it

#

Since it ironically worked for me

sour orchid
#

I feel like it’s a bit of a hacky solution tho

lament karma
#

physicists when you don't use 'task.' before a function

grizzled ore
#

normal wait is

#

laggy

#

boo

sour orchid
#

Exactly

#

Kill normal wait

grizzled ore
#

chat why dooes

#

roblox just deprecate normal wait

#

instead of

#

just fixing it

#

🧠

wary thorn
#

It might break other games

grizzled ore
#

pull the macos approach and say fuck the other games

wary thorn
#

so

grizzled ore
#

lol

sour orchid
#

Yeah that’s why they deprecate instead of straight up remove

lament karma
#

I ended up scripting it for tjem

grizzled ore
lament karma
#

Camera

modern copper
fallen meadow
#

im gonna guess that theres no easy way to do this but like
is there an efficient way to get the current line the cursor is on in a textbox

#

(working on a text editor thingy and it'd be neat to have the selected line to have a different coloration)

jagged lance
#

if that's what you're asking

modern copper
#

ok so

#

basically, no matter what I do

#

humanoid.Jumppower just doesnt work

torn spear
#

Is StarterPlayer.CharacterUseJumpPower set to true?

fallen meadow
#

(roblox) would anyone happen to know how to reverse a color correction effect

basically i just want a color that looks visually similar to another color when a color correction effect is applied

my original color is 82, 124, 174 (Steel blue)
and here is my colorcorrection

(itd be neat if someone could tell me the math behind colorcorrection so i could script it myself but a script would also be cool)

flat crow
#

So i'm having a rather weird issue

I've been developing a software for my parent's company and my computer charger broke and my new one won't be here for 3 weeks, so I decided to install linux on my aunt's old laptop that had gotten corrupted (probably had a virus).

I'm using Linux Mint on both computers, and on the original one I was using it was working fine and now on this one I cannot get VSC to import tkinter. I have the line from tkinter import filedialog, and it gives this error: ModuleNotFoundError: No module named 'tkinter'. However when I go to VSC's terminal and run pip install tk I get the response Requirement already satisfied: tk in /var/data/python/lib/python3.11/site-packages (0.1.0). Not sure what's happening and some help would be greatly appericated. I remember I had a similar problem with getting VSC working on my other linux machine, but that was related to the interpreter, not imports.

flat crow
#

Okay so it's possible the issue is my VSC is using the Python3 3.11.9 intepreter while the version installed on my computer is 3.12.3

#

So maybe I should try installing 3.11.9

#

nope that didn't fix it

lethal hull
#

point it to your preferred python install

flat crow
#

and yes I am using a venv

maiden dew
#

Typical Python dev moment tbh

#

Python venvs can be hellish to manage

wary thorn
#

Don’t use python clueless

sour orchid
#

exactly

flat crow
#

anyway I come with more questions because my tiny brain cannot work out some logic

#

So I'm writing a program for my parent's company that assists with address data set cleaning. I have a menu and everything working already, that's not hard at all, but now I can't figure out something and I know it's probably extremely simple.

One of the options is to import data, and when you do you will select a spreadsheet file and then pandas will convert it into a dataframe (basically just a glorified list I think)

def importNewData():
    print('\n')
    print('----------------')
    print('Import new Data')
    print('Please select spreadsheet file.')
    # This opens a file dialog that lets you choose the spreadsheet file
    filename = filedialog.askopenfilename()

    # Initialize data in spreadsheet as the dataframe currently being managed
    global df
    df = pd.read_excel(filename)
    print(df)
    print('\n')

    print('Data imported.')
    print('The dataset manager needs to know where to find data in the spreadsheet. Please type in the NAME of the column (ex: firstName) when prompted.')
    print('Please make sure to type it in exactly as it is displayed above, otherwise the dataset manager may not work properly. It is case sensitive.')
    print('\n')

    # The datasets always come in different formats so we have to select the correct rows to KEEP. Other columns will be discarded, which I can't figure out how to do. I know how to remove the columns that ARE selected, cause I could just say df.dropna(subset=['nFirstColumn'], inplace=True), but I need to do that to the ones that are NOT selected.

    nFirstColumn = input('First Names   >>>')
    nLastColumn = input('Last Names    >>>')
    sNumber = input('Street No     >>>')
    sName = input('Street Name   >>>')
    city = input('City          >>>')
    state = input('State         >>>')
    zip = input('Zip Code      >>>')
oblique dagger
#

I can rename it too anything but a word "Remove" it doesnt recognize it

#

do you guys think its a bug or what

sour orchid
#

so when you do instance.Remove

#

it thinks you are calling that function

#

so just change the name of the remove text label i guess

oblique dagger
#

k

ripe dirge
maiden dew
lament karma
#

(server script)

local event = game.ReplicatedStorage:WaitForChild("CheckGroup")

event.OnServerEvent:Connect(function(plr, gid, team)
    if plr:IsInGroup(gid) then
        plr.TeamColor = team
        plr:LoadCharacter()
        event:FireClient(plr, true)
    else
        event:FireClient(plr, false)
    end
end)```

(local script)
```lua
local gid = 15171650
local team = BrickColor.new("Storm blue")
local event = game.ReplicatedStorage:WaitForChild("CheckGroup")
local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Down:Connect(function()
    event:FireServer(plr, gid, team)
end)

event.OnClientEvent:Connect(function(isInGroup)
    if not isInGroup then
        script.Parent.Deny.ImageTransparency = 0.5
        wait(0.1)
        script.Parent.Deny.ImageTransparency = 1
        wait(0.1)
        script.Parent.Deny.ImageTransparency = 0.5
        wait(0.1)
        script.Parent.Deny.ImageTransparency = 1
        wait(0.1)
    end
end)```

so i get an 'unable to cast instance to int64' error and earlier it teamed the user to neutral
lethal hull
#

get rid of it and it'll work fine

lament karma
lament karma
lethal hull
#

and does your character at least respawn

lament karma
#

yes to both

#

it loads the character

lament karma
#

yes it does

odd chasm
#

har har i see a vulnerability

wary thorn
#

lol!

sour orchid
harsh flare
modern copper
#
local NewPart = Instance.new("MeshPart")

while true do
    wait(10)
    NewPart.Parent = game.workspace
    NewPart.MeshId = "rbxassetid://16121800660"
    NewPart.TextureID = "rbxassetid://16121800738"
end
#

shit is not working

torn spear
#

You can't change the MeshId property of MeshParts in runtime. You'll need to store and clone a copy of the mesh in ServerStorage or divert to using a SpecialMesh (collision wouldn't be the same tho).

lament karma
#

so i can't put it on the server

#

i mean i can but it'll just be really inefficient

harsh flare
lament karma
#

yeah it'd just be inefficient

#

cause

#

for example

#

gid = 2352384673
gid1 = 34582463
gid2 = 4328623496234

harsh flare
#

how many diffrent groups are there?

lament karma
#

10

#

or 11

#

i forgot

harsh flare
#

actually it would be more problematic in the

#

local

lament karma
#

well i mean

#

it works

#

so

#

don't touch it

harsh flare
#

so

lament karma
#

shut

#

up

#

it works

#

so i wont touch it

#

!!1

harsh flare
#

it needs to be if not isInGroup == true

lament karma
#

what

#

no

#

it can just be

#

if not isInGroup then

harsh flare
#

thats checking if the value is nil or not

lament karma
#

or

#

if isInGroup ~= true

lament karma
#

its true or false

harsh flare
#

wait

#

hmm

#

shit ive been doing this wrong haven't i

lament karma
#

stupi

harsh flare
#

ah

lament karma
#

this is why you're engineer

#

j

harsh flare
#

i can code an admin system but not this 😭

grizzled ore
modern copper
#

ok so

#

wait nvm

modern copper
#

ok so I have this script, what counts ur time.

#
local DataStoreService = game:GetService("DataStoreService")
local myDataStore = DataStoreService:GetDataStore("myDataStore")

game.Players.PlayerAdded:Connect(function(player)
    local leaderstats = Instance.new("Folder")
    leaderstats.Name = "leaderstats"
    leaderstats.Parent = player

    local Time = Instance.new("IntValue")
    Time.Name = "Time"
    Time.Parent = leaderstats

    local playerUserId = "Player"..player.UserId

    local data
    local success, errormessage = pcall(function()
        data = myDataStore:GetAsync(playerUserId)
    end)

    if success then
        Time.Value = data
    end

    while wait(60) do
        player.leaderstats.Time.Value = player.leaderstats.Time.Value + 1
    end
end)

game.Players.PlayerRemoving:Connect(function(player)
    local playerUserId = "Player"..player.UserId

    local data = player.leaderstats.Time.Value

    myDataStore:SetAsync(playerUserId, data)
end)
#

and I tried to make a time requirement for my team changer

#
local team = game.Teams["mall cop"]

script.Parent.MouseButton1Click:Connect(function(player)
    if player.leaderstats.Time.Value < 3 then
        script.Parent.Text = "Not Enough Time!"
        wait(2)
        script.Parent.Text = ":police_car: mall cop"
    else
        if team:FindFirstChild("TeamCap") then
            if team:FindFirstChild("TeamCap").Value > #team:GetPlayers() then
                script.Parent.Parent.Parent.Parent.Parent.TeamColor = BrickColor.new("Really red")
                script.Parent.Parent.Parent.Parent.Parent.Character.Humanoid.Health = 0
            else
                script.Parent.Text = "Team Full"
                wait(2)
                script.Parent.Text = ":police_car: mall cop"
            end
        end
    end
end)

#

but it always gives this error

odd chasm
#

hi i look at this in a sec

modern copper
harsh flare
lament karma
#

not the model

#

you need to do

#

local plr = game.Players:GetPlayerFromCharacter(player)

#

also to replace your teamchange thingy

#

you can use an event

#

for example

#
            if team:FindFirstChild("TeamCap").Value > #team:GetPlayers() then
                event:FireServer(plr,BrickColor.new("Really red"))
            else```
#

server script

event.FireClient:Connect(plr,color) -- (or server i forgor)
plr.Team = color
end)```
#

something like that

#

idk i forgor

oblique dagger
#

I wonder, is there any animatable alternatives

#

What I encounter a decision or finding something convenient to use is animating something on unanchored-welded model

#

Pick an example of a train in roblox, as of right now I use constraint to animate stuff like doors which I always need to avoid anchoring a door

#

I used to use animation but its unecessary complex and animation doesnt work when unanchored

#

while tweening and cframe doesnt work properly when unanchored since I need to define rotation and position

#

Therefore, I wonder is there any alternative of for example sliding door or moving doors on train or perhaps unanchored model than using constraints

flat crow
#

Just gonna revive this thread so people remember it exists

maiden dew
#

Let it die

odd chasm
grizzled ore
#

this thread has really no point when #975913402453086228 exists

#

this is literally #975913402453086228 but more specific

lament karma
#

technology in my opinion

#

is more for stuff like servers and pcs and whatnot

#

or cellphones even

#

not like coding

grizzled ore
modern copper
#
-- variabes
local GUI = game.StarterGui
local Frame = GUI.ScreenGui.Frame
local display = Frame.Display

local one = Frame.One
local two = Frame.Two
local three = Frame.Three
local four = Frame.Four
local five = Frame.Five
local six = Frame.Six
local seven = Frame.Seven
local eight = Frame.Eight
local nine = Frame.Nine
local zero = Frame.Zero

-- script

one.MouseButton1Click:Connect(function()
    display.Text = display.Text .. "1"
end)
#

idk why but this doesnt work

#

fixed it

flat crow
#

At least in python, if you declare a local variable it only works in the function you declared it in, so if that’s the same in LUAU then declaring a local outside of the function it’s being used in shouldn’t work

fallen meadow
grizzled ore
flat crow
#

I have like, once

sour orchid
#

it is best practice to declare variables as local

grizzled ore
#

why what problems happen if its not local

torn spear
#

Scripts run slower with global variables and logic problems can happen with certain setups. Using local variables is overall just better.

#

Here's an example of a problem caused by global behavior:

for i,v in pairs(Doors:GetChildren()) do
    deb = false --// GLOBAL
    v.ClickDetector.MouseClick:Connect(function()
        if deb then return end
        deb = true
        --// Door stuff here
        deb = false
    end)
end

deb being global makes the debounce activation affect every door. If it was local, then the variable would stay to just a single door like it should. It's all about scope.

flat crow
#

That’s true

#

I just tend to work with globals a lot

wary thorn
#

please don't over use it

#

šŸ™

#

its not a good practice

flat crow
#

Plus I do mostly python

wary thorn
#

alr

torn spear
#

Only use _G if you're a masochist, but even then don't use it 'cause it's a fucking mistake and it's not that hard to just use a ModuleScript.

harsh flare
sour orchid
#

u can do like _G.blahblah = 5 and stuff