#How i can use remote event on part in workspace?
297 messages · Page 1 of 1 (latest)
._.
i'm confused
what do you need the remoteevent to do
you need help with fire it?
i have portal to unlock and i want the only player who unlocked it can get in
and i dont know how its work the remote event
so i need help
that can be solved just by a local script
hm
but idk what you scripted
you don't need a remote event for this, correct
so what to do
well you need to give me more details here
you can find somethin about remote events in here
i tried to check it little wait
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
ok i sending chill
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)
all you'd need to do is transfer this over to a localscript, give me a minute
i using workspace
and maby do the locks by true/false, in script
but if you dont need to reach the locking thing in another script
i need it too
ok
with the remote
sorry show what? the place that lock where?
** script.Parent.Parent**.Stage2PortalLock.Lock4.Transparency = 1
this
where is this in the explorer
ok
where's the script located?
ok.
the script i sent its in the script at blue
and the lock up
its in folder at workspace
oh
?
you have locks for each stage, correct?
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
what i meant is, you have several stages that are locked
yea
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
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
you can edit the stage in the first line
yes
place it here actually
wait hold on
i edited it
missed one thing
would've been great to have from the beginning, that's specifically what i asked for
wait
i'll fix it
yea i didn't know you would do something like that sry
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
k
add this localscript to here
instead of startercharacterscripts
lemme know if it works
and btw the start of the script its should be leaderstats
what
local numberOfStages = 2
the "Stages" what i show with my script
its was leaderstats
???
i wrote "local numberOfStages = 2" so you could change the amount of stages there are as you add more of them
if you had 3 stages, you would change "local numberOfStages = 2" to "local numberOfStages = 3"
oh my god
you're misunderstanding so hard dude
if you can't read my script just say it
check if it works
ok
its just so diffrent from mine so its confused me
and its wrong but ok
it's wrong how?
let me check the part if its work anyway
I talked about value that its prob dont work like i want
you're making no sense whatsoever
you just cant understand me
you actually don't
you're just stringing random words together hoping it does make sense
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
what fucking leaderstats are you on about, i'm actually getting frustrated now
that's not the issue
if its not the issue
so i dont know
i will screen shot you again like before
folder - stage lobby - stage2portal - stage2portallock
ok i think
not stage2portal
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
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?
yes, what about it? it limits the for loop so it doesn't try to find an infinite amount of stage portals
its should just do if player have the specific leaderstats value and its will make it change the parts (for one portal)
that's what it is doing
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
price of the leaderstats?
not rly the price
i mean
the amount the value u need
to join to the portal
its the number its looping for find the portal
it's not looping anything
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
there is only 1 portal i need for the leaderstats
Im donig specific quest for every portal
I just need example
numberOfStages limits i so it doesn't go to infinity
but i dont need it to the leaderstats
if numberOfStages was equal to 3, it'd do i = 1, i = 2, i = 3
you don't need what to the leaderstats?
what u just said now
it doesn't unlock all
i see it very goood
it doesn't work because of this
did you not see the error either?
cuz i said not all portal are the same
i sent you the error .-.
show me whats inside of this
i know you did, and the error clearly says why it doesn't work
i don't know why you're going on about leaderstats
I said not all portal are the same
for the portal 2
can you make them the same?
but its not what i want
is stage 1 unlocked from the beginning
so i need to remove 1
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
how did you remove 1 i can ask?
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"
if numberOfStages was 3, it'd do 2, 3
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
you'd have to store data
** You are now Level 11! **
i'm not about to write another script for you man
why data store?
how else would you store data between different sessions?
yk i cant understand things like you
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
dam
** You are now Level 9! **
now my brain rly out
so did it work?
nope but just never mind about all its the best that i will try to die while try to understand it alone
so it did error?
so?
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
do you have wait(5) at the top
no
what do you mean
wait nvm
ok now thank me for wasting over an hour of my time
ok thx putin
putin?
jk cuz you said wasting of my time like you kind
king*
just nvm
thx for the helpp