#How i can use remote event on part in workspace?

297 messages · Page 1 of 1 (latest)

brazen carbon
#

wdym

#

just use it

wheat ravine
#

._.

tacit plank
#

i'm confused

wheat ravine
#

i didn't mean just to ass it

#

add*

tacit plank
#

what do you need the remoteevent to do

brazen carbon
#

you need help with fire it?

wheat ravine
#

and i dont know how its work the remote event

#

so i need help

brazen carbon
#

that can be solved just by a local script

wheat ravine
#

hm

brazen carbon
#

but idk what you scripted

wheat ravine
#

i dont know how to do remote event but

#

ok let me send

#

if its help

tacit plank
#

you don't need a remote event for this, correct

wheat ravine
tacit plank
#

well you need to give me more details here

brazen carbon
wheat ravine
tacit plank
#

what does the portal look like, how does the unlocking system work?

#

i can't just read your mind and spit out a fully working script for you

wheat ravine
#

ok i sending chill

tacit plank
#

i not chilling >:(((

#

very angery

wheat ravine
#

local BadgeService = game:GetService("BadgeService")
local BadgeId = 2128795845
local limit = 1

script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then

    local player = game.Players:GetPlayerFromCharacter(hit.Parent)

    --

        --if BadgeService:UserHasBadge(player.UserId, BadgeId) then
        

    if player.Stages.Value >= limit then

print("edwgwhpeng")

            script.Parent.Transparency = 0.5
            script.Parent.CanCollide = false
            script.Parent.Parent.Stage2PortalLock.LockUnion.Transparency = 1
            script.Parent.Parent.Stage2PortalLock.Lock1.Transparency = 1
            script.Parent.Parent.Stage2PortalLock.Lock2.Transparency = 1
            script.Parent.Parent.Stage2PortalLock.Lock3.Transparency = 1
            script.Parent.Parent.Stage2PortalLock.Lock4.Transparency = 1
            script.Parent.Parent.Stage2PortalLock.LockUnion.CanCollide = false
            script.Parent.Parent.Stage2PortalLock.Lock1.CanCollide = false
            script.Parent.Parent.Stage2PortalLock.Lock2.CanCollide = false
            script.Parent.Parent.Stage2PortalLock.Lock3.CanCollide = false
            script.Parent.Parent.Stage2PortalLock.Lock4.CanCollide = false
        end)
        end

end
end)

tacit plank
#

all you'd need to do is transfer this over to a localscript, give me a minute

wheat ravine
#

i using workspace

brazen carbon
#

and maby do the locks by true/false, in script

#

but if you dont need to reach the locking thing in another script

wheat ravine
#

i need it too

brazen carbon
#

ok

wheat ravine
#

with the remote

tacit plank
#

where is script.Parent.Parent relative to the workspace?

#

show hierarchy

wheat ravine
#

sorry show what? the place that lock where?

tacit plank
#

** script.Parent.Parent**.Stage2PortalLock.Lock4.Transparency = 1

#

this

#

where is this in the explorer

wheat ravine
#

ok

tacit plank
#

where's the script located?

wheat ravine
#

ok.

#

the script i sent its in the script at blue

#

and the lock up

#

its in folder at workspace

tacit plank
#

oh

wheat ravine
#

?

tacit plank
#

you have locks for each stage, correct?

wheat ravine
#

yea but all the locks you see its one lock

#

yk lock from not one part

#

well if its little problem i can make it union

tacit plank
#

what i meant is, you have several stages that are locked

wheat ravine
#

like i going to do it

#

but there is no now

#

but i can just add it to new remote event isn't?

#

or the same remote event?

#

so you can explain how i can do it? i dont wanna ask it over and over in this server

tacit plank
#
local stage = 2

--don't edit past here
local players = game:GetService("Players")
local portal = workspace:FindFirstChild("Stage"..stage.."Portal")

portal.Stage2PortalLock.VisibleWallLockPart.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if player == players.LocalPlayer and player.Stages.Value >= stage then
            portal.Stage2PortalLock.VisibleWallLockPart.Transparency = 0.5
            portal.Stage2PortalLock.VisibleWallLockPart.CanCollide = false
            portal.Stage2PortalLock.LockUnion.Transparency = 1
            portal.Stage2PortalLock.Lock1.Transparency = 1
            portal.Stage2PortalLock.Lock2.Transparency = 1
            portal.Stage2PortalLock.Lock3.Transparency = 1
            portal.Stage2PortalLock.Lock4.Transparency = 1
            portal.Stage2PortalLock.LockUnion.CanCollide = false
            portal.Stage2PortalLock.Lock1.CanCollide = false
            portal.Stage2PortalLock.Lock2.CanCollide = false
            portal.Stage2PortalLock.Lock3.CanCollide = false
            portal.Stage2PortalLock.Lock4.CanCollide = false
        end
    end
end)
#

try puttin this in a local script

wheat ravine
#

hm ok

#

local script?

tacit plank
#

you can edit the stage in the first line

#

yes

#

place it here actually

#

wait hold on

#

i edited it

#

missed one thing

wheat ravine
#

dam

#

ok

#

i think i should show you full

tacit plank
#

would've been great to have from the beginning, that's specifically what i asked for

wheat ravine
#

wait

tacit plank
#

i'll fix it

wheat ravine
#

yea i didn't know you would do something like that sry

tacit plank
#
local numberOfStages = 2

--don't edit past here
local players = game:GetService("Players")
local stageLobby = workspace:WaitForChild("StageLobbyMain"):WaitForChild("Stage-Lobby")

for i = 1, numberOfStages do
    local portal = stageLobby:FindFirstChild("Stage"..i.."Portal")
    local portalLock = portal:FindFirstChild("Stage"..i.."PortalLock")
    portalLock.VisibleWallLockPart.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            if player == players.LocalPlayer and player.Stages.Value >= i then
                portalLock.VisibleWallLockPart.Transparency = 0.5
                portalLock.VisibleWallLockPart.CanCollide = false
                portalLock.LockUnion.Transparency = 1
                portalLock.Lock1.Transparency = 1
                portalLock.Lock2.Transparency = 1
                portalLock.Lock3.Transparency = 1
                portalLock.Lock4.Transparency = 1
                portalLock.LockUnion.CanCollide = false
                portalLock.Lock1.CanCollide = false
                portalLock.Lock2.CanCollide = false
                portalLock.Lock3.CanCollide = false
                portalLock.Lock4.CanCollide = false
            end
        end
    end)
end
wheat ravine
#

k

tacit plank
#

add this localscript to here

#

instead of startercharacterscripts

#

lemme know if it works

wheat ravine
#

and btw the start of the script its should be leaderstats

tacit plank
#

what

wheat ravine
#

local numberOfStages = 2

#

the "Stages" what i show with my script

#

its was leaderstats

tacit plank
#

???

#

i wrote "local numberOfStages = 2" so you could change the amount of stages there are as you add more of them

wheat ravine
#

i didn't mean to that

#

but whatever

#

check it

tacit plank
#

if you had 3 stages, you would change "local numberOfStages = 2" to "local numberOfStages = 3"

wheat ravine
#

nooo

#

the stages its leaderstats

#

value

tacit plank
#

oh my god

wheat ravine
#

i wrote it at the start of that cchat

#

v

tacit plank
#

you're misunderstanding so hard dude

#

if you can't read my script just say it

#

check if it works

wheat ravine
#

ok

wheat ravine
#

and its wrong but ok

tacit plank
#

it's wrong how?

wheat ravine
#

let me check the part if its work anyway

#

I talked about value that its prob dont work like i want

tacit plank
#

you're making no sense whatsoever

wheat ravine
#

you just cant understand me

tacit plank
#

you're right, i can't

#

that's what i'm saying

wheat ravine
#

yea

#

its not like i make no sense

tacit plank
#

you actually don't

#

you're just stringing random words together hoping it does make sense

wheat ravine
#

im not but ok

#

and there is error btw

tacit plank
#

okay hold on

#
local numberOfStages = 2

--don't edit past here
local players = game:GetService("Players")
local stageLobby = workspace:WaitForChild("StageLobbyMain"):WaitForChild("Stage-Lobby")

for i = 1, numberOfStages do
    local portal = stageLobby:WaitForChild("Stage"..i.."Portal")
    local portalLock = portal:WaitForChild("Stage"..i.."PortalLock")
    portal.VisibleWallLockPart.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            if player == players.LocalPlayer and player.Stages.Value >= i then
                portal.VisibleWallLockPart.Transparency = 0.5
                portal.VisibleWallLockPart.CanCollide = false
                portalLock.LockUnion.Transparency = 1
                portalLock.Lock1.Transparency = 1
                portalLock.Lock2.Transparency = 1
                portalLock.Lock3.Transparency = 1
                portalLock.Lock4.Transparency = 1
                portalLock.LockUnion.CanCollide = false
                portalLock.Lock1.CanCollide = false
                portalLock.Lock2.CanCollide = false
                portalLock.Lock3.CanCollide = false
                portalLock.Lock4.CanCollide = false
            end
        end
    end)
end
wheat ravine
#

k

#

and if its not the problem

#

so the leaderstats its the prob

tacit plank
#

what fucking leaderstats are you on about, i'm actually getting frustrated now

#

that's not the issue

wheat ravine
#

if its not the issue
so i dont know

tacit plank
#

the script can't find stage1portallock

#

does stage 1 have a portal lock

wheat ravine
#

i will screen shot you again like before

#

folder - stage lobby - stage2portal - stage2portallock

tacit plank
#

THAT'S NOT THE ISSUE

#

expand stage1portal

wheat ravine
#

ok i think

tacit plank
#

not stage2portal

wheat ravine
#

yea

#

its beacuse of the limited at start of the script

#

you made it so the all the portal will need to have the same

tacit plank
#

oh my fucking god

#

it doesn't???

wheat ravine
#

i said i just need to make the part diffrent from the player but i need for one portal leaderstats

#

that's all

#

you want i will explain you more?

tacit plank
#

i'm done with this

#

i legit just can not understand you

#

sorry dude

wheat ravine
#

the start of your script dude

#

cuz you did numberOfStages

#

its crashed all

tacit plank
#

yes, what about it? it limits the for loop so it doesn't try to find an infinite amount of stage portals

wheat ravine
#

its should just do if player have the specific leaderstats value and its will make it change the parts (for one portal)

tacit plank
#

that's what it is doing

wheat ravine
#

so you did it wrong cuz its need to be the price of the leaderstats but you did it with the stage models numbers and its make it to be with the first stage

tacit plank
#

price of the leaderstats?

wheat ravine
#

i mean

#

the amount the value u need

#

to join to the portal

tacit plank
wheat ravine
#

"i"

tacit plank
#

yes, i

#

do you not know how for loops work?

wheat ravine
#

its the number its looping for find the portal

tacit plank
#

it's not looping anything

wheat ravine
#

i cant explain it

tacit plank
#

what it does is it goes through all of the portals in stage-lobby one by one (i = 1, i = 2, i = 3, etc) and connects each one to a function if its wall is touched

wheat ravine
#

there is only 1 portal i need for the leaderstats

#

Im donig specific quest for every portal

#

I just need example

tacit plank
#

numberOfStages limits i so it doesn't go to infinity

wheat ravine
#

to understand how to make it to every part of portal

#

ok got it so its till 2

tacit plank
#

yes

#

it does i = 1 and then i = 2

wheat ravine
#

but i dont need it to the leaderstats

tacit plank
#

if numberOfStages was equal to 3, it'd do i = 1, i = 2, i = 3

#

you don't need what to the leaderstats?

wheat ravine
#

what u just said now

tacit plank
#

why are we talking about leaderstats

#

this is to unlock the portal

wheat ravine
#

yea

#

one portal

#

not all

tacit plank
#

it doesn't unlock all

wheat ravine
#

yea

#

but its not work

#

so its the only reason i can tell

tacit plank
#

do you not see this

wheat ravine
#

i see it very goood

tacit plank
#

did you not see the error either?

wheat ravine
#

cuz i said not all portal are the same

wheat ravine
tacit plank
#

show me whats inside of this

tacit plank
#

i don't know why you're going on about leaderstats

wheat ravine
#

I said not all portal are the same

wheat ravine
tacit plank
#

can you make them the same?

wheat ravine
#

but its not what i want

tacit plank
#

is stage 1 unlocked from the beginning

wheat ravine
#

yea

#

yea

tacit plank
#

so skip stage 1 basically?

#

ok wait

wheat ravine
#

so i need to remove 1

tacit plank
#
local numberOfStages = 2

--don't edit past here
local players = game:GetService("Players")
local stageLobby = workspace:WaitForChild("StageLobbyMain"):WaitForChild("Stage-Lobby")

for i = 2, numberOfStages do
    local portal = stageLobby:WaitForChild("Stage"..i.."Portal")
    local portalLock = portal:WaitForChild("Stage"..i.."PortalLock")
    portal.VisibleWallLockPart.Touched:Connect(function(hit)
        if hit.Parent:FindFirstChild("Humanoid") then
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            if player == players.LocalPlayer and player.Stages.Value >= i then
                portal.VisibleWallLockPart.Transparency = 0.5
                portal.VisibleWallLockPart.CanCollide = false
                portalLock.LockUnion.Transparency = 1
                portalLock.Lock1.Transparency = 1
                portalLock.Lock2.Transparency = 1
                portalLock.Lock3.Transparency = 1
                portalLock.Lock4.Transparency = 1
                portalLock.LockUnion.CanCollide = false
                portalLock.Lock1.CanCollide = false
                portalLock.Lock2.CanCollide = false
                portalLock.Lock3.CanCollide = false
                portalLock.Lock4.CanCollide = false
            end
        end
    end)
end
wheat ravine
#

but what about the 3,4,5,6,7....

#

i dont know if its gonna be the smae

#

same*

tacit plank
#

you only have to make these objects have the same name

wheat ravine
tacit plank
#

you can edit everything else

#

it starts from 2 now and goes up to numberOfStages (which is 2 in this case), so it only does the 2nd stage

#

"for i = 2"

wheat ravine
#

of right

#

i blind

tacit plank
#

if numberOfStages was 3, it'd do 2, 3

wheat ravine
#

i was think its 2 before too

#

here there

#

let me check

#

how to do that i dont need to touch the part every time i join

#

that i need to touch it only one time

tacit plank
#

you'd have to store data

trim thunder
#

studio** You are now Level 11! **studio

tacit plank
#

i'm not about to write another script for you man

wheat ravine
#

why data store?

tacit plank
#

how else would you store data between different sessions?

wheat ravine
tacit plank
#

so you already have that

#

ok

wheat ravine
tacit plank
#
wait(5)
local numberOfStages = 2

--don't edit past here
local player = game:GetService("Players").LocalPlayer
local stageLobby = workspace:WaitForChild("StageLobbyMain"):WaitForChild("Stage-Lobby")

for i = 2, numberOfStages do
    local portal = stageLobby:WaitForChild("Stage"..i.."Portal")
    local portalLock = portal:WaitForChild("Stage"..i.."PortalLock")
    if player.Stages.Value >= i then
        unlock(portal, portalLock)
    else
        portal.VisibleWallLockPart.Touched:Connect(function(hit)
            if hit.Parent:FindFirstChild("Humanoid") then
                local _player = game.Players:GetPlayerFromCharacter(hit.Parent)
                if player == _player and player.Stages.Value >= i then
                    unlock(portal, portalLock)
                end
            end
        end)
    end
end

function unlock(portal, portalLock)
    portal.VisibleWallLockPart.Transparency = 0.5
    portal.VisibleWallLockPart.CanCollide = false
    portalLock.LockUnion.Transparency = 1
    portalLock.Lock1.Transparency = 1
    portalLock.Lock2.Transparency = 1
    portalLock.Lock3.Transparency = 1
    portalLock.Lock4.Transparency = 1
    portalLock.LockUnion.CanCollide = false
    portalLock.Lock1.CanCollide = false
    portalLock.Lock2.CanCollide = false
    portalLock.Lock3.CanCollide = false
    portalLock.Lock4.CanCollide = false
end
#

try this

wheat ravine
#

dam

trim thunder
#

studio** You are now Level 9! **studio

wheat ravine
#

now my brain rly out

tacit plank
#

so did it work?

wheat ravine
#

nope but just never mind about all its the best that i will try to die while try to understand it alone

tacit plank
#

nope as in it didn't unlock?

#

did it error?

wheat ravine
#

its didn't unlock

#

and error

tacit plank
#

so it did error?

wheat ravine
#

y

tacit plank
#

i need to add a wait() hold on

#

i edited it

wheat ravine
#

ok..

#

wait 5 sec

#

dam

tacit plank
#

so?

wheat ravine
tacit plank
#

my bad

#
wait(5)
local numberOfStages = 2

--don't edit past here
local player = game:GetService("Players").LocalPlayer
local stageLobby = workspace:WaitForChild("StageLobbyMain"):WaitForChild("Stage-Lobby")

function unlock(portal, portalLock)
    portal.VisibleWallLockPart.Transparency = 0.5
    portal.VisibleWallLockPart.CanCollide = false
    portalLock.LockUnion.Transparency = 1
    portalLock.Lock1.Transparency = 1
    portalLock.Lock2.Transparency = 1
    portalLock.Lock3.Transparency = 1
    portalLock.Lock4.Transparency = 1
    portalLock.LockUnion.CanCollide = false
    portalLock.Lock1.CanCollide = false
    portalLock.Lock2.CanCollide = false
    portalLock.Lock3.CanCollide = false
    portalLock.Lock4.CanCollide = false
end

for i = 2, numberOfStages do
    local portal = stageLobby:WaitForChild("Stage"..i.."Portal")
    local portalLock = portal:WaitForChild("Stage"..i.."PortalLock")
    if player.Stages.Value >= i then
        unlock(portal, portalLock)
    else
        portal.VisibleWallLockPart.Touched:Connect(function(hit)
            if hit.Parent:FindFirstChild("Humanoid") then
                local _player = game.Players:GetPlayerFromCharacter(hit.Parent)
                if player == _player and player.Stages.Value >= i then
                    unlock(portal, portalLock)
                end
            end
        end)
    end
end
wheat ravine
#

its just keep going

#

i should try to understand that alone

tacit plank
#

do you have wait(5) at the top

wheat ravine
#

no

tacit plank
#

because i edited it shortly after i sent it

#

add it

wheat ravine
#

its did it alone

#

but for normal player

#

its will be diffrent?

tacit plank
#

what do you mean

wheat ravine
#

wait nvm

tacit plank
#

nono

#

explain

wheat ravine
#

no i said someting stupid

#

just nvm about what i just said

tacit plank
#

ok now thank me for wasting over an hour of my time

wheat ravine
#

ok thx putin

tacit plank
#

putin?

wheat ravine
#

jk cuz you said wasting of my time like you kind

#

king*

#

just nvm

#

thx for the helpp

tacit plank
#

it was a truly the most anger-filled hour of my day because of your poor communication and insisting that i'm wrong even though you have no idea what you're talking about

#

no problem though

wheat ravine
#

hm i had idea you just didn't understnad

#

just nvm

#

i dont wanna fight rn

#

just help for the help