#Level Door Help
105 messages · Page 1 of 1 (latest)
Just check on touch for their level and if they have it, un-collide, but only on the client.
but how do you only do it on the client?
A local script, if you want to be really primitive put one inside of starterplayer and reference the door in workspace.
As far as I know, the StarterPlayer folder only fires once to be created when a player joins the game.
no but a local script doesnt work like that i swear
bc it cannot see workspace
as they need to own it ive tried that already
They're literally inside of workspace
Workspace is visible to client and server.
Whatever the client does in workspace
OTHER clients will NOT see
Only that client will.
But if you do it on the server, every client will see it.
You could call the client, from the server, to then run the script.
Which would be ideal.
you get the error Part is not a valid member of Workspace "Workspace" when running this code
local MoonDoor = game.Workspace.Part
local player = game.Players.LocalPlayer
local ls = player:WaitForChild("leaderstats")--Get's the leaderstats
local wins = ls:WaitForChild("Wins")
while wait() do
if wins.Value <= 10 then --MoonDoor
MoonDoor.CanCollide = false
MoonDoor.Transparency = 0.5
end
end
unless this is just me but everything is fine
:WaitForChild
TheScript runs on player load, not world/character load
So WAIT for the part to be loaded, and then it will work. If it doesn't, it will 'infinitely' yield
put local script inside a part ;-; ?
Where is part
That would be dumb
bro
its only 1
wym in the world
Have you tried testing, then checking if part is still in wokspace?
Workspace is everything you see in the 3d world
i mean when i play its there
print(MoonDoor)
It won't be able to run
** You are now Level 6! **
It is infinitely yielding the code below it from running
That is what infinite yield possible means
Sometimes that runs because it took a little while to load
Meaning it yields and then stops after a little
Because the part HAS TO LOAD
it has
Think of the script
Because it waited
and waited
and waited
and then suddenly loaded the part
And then once loaded, code under it runs
why tf are you doing a while loop
Just check on signal
MoonDoor.Touched:Connect(function()
if wins.Value <= 10 then --MoonDoor
MoonDoor.CanCollide = false
MoonDoor.Transparency = 0.5
end
end)
but its on touch
It only needs to check once
no
For when they touch, for it to turn on
the value is increasing
Then its on for ever
they need to be able to see visally
It doesn't matter if it increases??
You're always setting it to canCollide false, IF they have wins.Value <= 10
wins:GetPropertyChangedSignal("Value"):Connect(function()
if wins.Value <= 10 then --MoonDoor
MoonDoor.CanCollide = false
MoonDoor.Transparency = 0.5
end
end)
ahh
** You are now Level 7! **
local connection
connection = wins:GetPropertyChangedSignal("Value"):Connect(function()
if wins.Value <= 10 then --MoonDoor
MoonDoor.CanCollide = false
MoonDoor.Transparency = 0.5
connection:Disconnect()
end
end)
...
no
So they can lose wins?
yes wins go up and down
good luck
thanks