#I am desperate (HELP ME WITH LOCAL PARTS!!!)

82 messages · Page 1 of 1 (latest)

sturdy halo
#

So a server script sets the bool value to true/false and you want a local part to change collision to the value of the boolvalue instance?

viral delta
#

imma try doing the script

crisp gyro
viral delta
# crisp gyro thank u so much!

is this what u meant ```lua
local part = nil --replace nil with the part path
local baseplate = nil --replace nil with the baseplate path

part.Touched:Connect(function(hit)
local players_data = nil --replace nil with the path of player data
local bool = players_data.Boolean

bool = true

bool:GetPropertyChangedSignal("Value"):Connect(function()
    if bool.Value == true then
        part.CanCollied = true
    end
end)

bool:GetPropertyChangedSignal("Value"):Connect(function()
    part.CanCollied = false
end)

end)

#

hit is the player

#

that touched the part

viral delta
# crisp gyro thank u so much
local part = nil --replace nil with the part path
local baseplate = nil --replace nil with the baseplate path 

part.Touched:Connect(function(hit)
    local character = hit.Parent
    if not character:IsA("Model") then
        return
    end

    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then
        return
    end

    local player = game.Players:GetPlayerFromCharacter(character)
    if not player then
        return
    end
    local players_data = nil --replace nil with the path of player data
    local bool = players_data.Boolean
    
    bool = true
    
    bool:GetPropertyChangedSignal("Value"):Connect(function()
        if bool.Value == true then
            part.CanCollied = true
        end
    end)
    
    bool:GetPropertyChangedSignal("Value"):Connect(function()
        part.CanCollied = false
    end)
    
end)

i got u the character humanoid and player

rotund wraithBOT
#

studio** You are now Level 2! **studio

viral delta
sturdy halo
#

And also he wanted the part to be changed locally. I think

crisp gyro
#

this doesnt change it locally?

rotund wraithBOT
#

studio** You are now Level 2! **studio

sturdy halo
viral delta
#

so the part is local but the base plate isnt

#

gotcha

crisp gyro
viral delta
#

yk the path of the path?

#

omg

#

the path of the part

crisp gyro
#

yes

viral delta
#

try moving the local part = --path to part

inside the function p.touched

viral delta
#

so ill make it for you

#

is it located inside the player?

crisp gyro
#

game.Workspace.Lvl2

sturdy halo
#

Local parts the server cannot see

#

If you try to change it, it will return nil and therefor error

viral delta
#

alright

crisp gyro
sturdy halo
#

If you destroy the baseplate in the local script no one other than the client can see it

sturdy halo
#

Cuz server storage is only accesible by server

viral delta
#

so

#

idk if it works but try making a local script

#

and put the script i sent in it

sturdy halo
#

That might do the trick

crisp gyro
#

local PartLvl2 = game.Lighting.Lvl2
local Baseplate0 = PartLvl2.Baseplate0:Clone()
Baseplate0.Parent = game.Workspace.Lvl2

sturdy halo
#

You seem pretty skilled @viral delta

viral delta
#

thanks :))

#

you too

crisp gyro
sturdy halo
#

Wth?

viral delta
#

lol

crisp gyro
#

i saved it in lightingn

sturdy halo
#

Why did u put anything for storage in lighting

viral delta
#

dont put instances in lighting

crisp gyro
#

i dont know someone on yt told me so

viral delta
#

it works but its weirdddd

sturdy halo
sturdy halo
crisp gyro
sturdy halo
#

Use replicated storsge

#

Since it will be replicated for both server and client

crisp gyro
#

ill do it

sturdy halo
#

What are you making?

#

Like what kind of game

crisp gyro
#

like a parkour with different short parts

#

and each part has few checkpoints

viral delta
#

so ur trying the progress?

crisp gyro
#

yes

#

i want it to work with a viriable in the player so that if the player changes part i can reset the local part easly

viral delta
#

if u want to save the progress

#

u should use datastore

crisp gyro
#

i already did

#

but u can play again every single part

viral delta
#

does the script work?

crisp gyro
#

yes everything works

#

exept for this thing

viral delta
#

does the script work?

crisp gyro
#

i tried but it doesnt work

rotund wraithBOT
#

studio** You are now Level 3! **studio

crisp gyro
#

i think it's because that part is local

#

and i cant interact with that local part with a "universal" script

viral delta
#

if u put the script i gave u in a local script it will get only the local part