#script code not working

1 messages · Page 1 of 1 (latest)

normal summit
#

i dont know what is wrong

silk geode
normal summit
#

yeh ik i chnaged that

#

but it still dose not work

#

ill show you what i mean give me a sec

#

@silk geode

silk geode
#

ofc it doesnt work

#

the leaderstat was 1

normal summit
#

?

#

so if i change that to 2?

silk geode
#

no change the leader stat to 0

#

you wrote that in the code urself

#

if the part's number is bigger than the leader stat by 1 it update the leaderstat

normal summit
#

i changed it still not working

silk geode
normal summit
#

like again?

silk geode
#

ye

normal summit
#

i changed it

silk geode
normal summit
#

i think i put it in the right spot

silk geode
normal summit
solemn knollBOT
#

studio** You are now Level 1! **studio

normal summit
silk geode
#

i said change the leaderstat value to 0

normal summit
#

did i not do that?

silk geode
silk geode
normal summit
silk geode
#

im talking about this

normal summit
#

thats the only error

silk geode
#

capitalize the v in value

normal summit
#

mate this is the leaderbored one

#

the other one was the checkpoint

silk geode
silk geode
silk geode
normal summit
#

stil dont work

silk geode
#

any error?

normal summit
#

only this one

silk geode
normal summit
#

wym send you the output tab

silk geode
normal summit
#

there

silk geode
#

alr

#

wait for me a lil bit

normal summit
#

alr

#

there the 2 scripts btw

normal summit
silk geode
normal summit
#

oh ty man

solemn knollBOT
#

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

silk geode
normal summit
#

doy uo want me to invite you to the roblox studios or smth?

silk geode
#

oh i didnt say im gonna directly fix it

normal summit
#

ohh mb

silk geode
#

i just fixed it by dropping you a fixed one

#

you watched the video yet?

normal summit
#

yeh i did

#

so waht was wrong with min

#

what*

silk geode
#

i will send you the script so you know what's wrong

solemn knollBOT
#

studio** You are now Level 5! **studio

normal summit
#

ok

#

ty man

silk geode
#

make sure to turn on the spawnpouint 's cantouch if you somehow turned it off

#

game.Players.PlayerAdded:Connect(function(player)
local ls = Instance.new("Folder", player)
ls.Name = "leaderstats"
local stage = Instance.new("IntValue", ls)
stage.Value = 0
stage.Name = "Stage"
end)

#

local stagenumber = tonumber(script.Parent.Name)
local PS = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
local character
if hit.Parent:FindFirstChild("Humanoid") then
character = hit.Parent
elseif hit.Parent.Parent:FindFirstChild("Humanoid") then
character = hit.Parent.Parent
end

local player = PS:GetPlayerFromCharacter(character)
local playerstage = player.leaderstats.Stage
if stagenumber - playerstage.Value == 1 then
    playerstage.Value = stagenumber
end

end)

normal summit
#

like this

#

?

silk geode
#

no

#

2 scripts

normal summit
#

oh

silk geode
#

just like you did before

normal summit
#

one leaderbored one checkpoint?

silk geode
#

yes

normal summit
#

oh sorry

#

whatone is the leaderbored

silk geode
#

just watch the 2 image i sent

#

they are different scripts

normal summit
#

i did that

#

still did not work

#

at all

silk geode
#

one is in scriptservice and one is in "1"

silk geode
normal summit
#

othere then humanoid no

silk geode
#

@normal summit so does it work?

normal summit
normal summit
silk geode
normal summit
#

yoooo

#

OMG

#

DUDE

#

tysm

#

your a leg

silk geode
normal summit
#

huh yeh ik i did that on purpose

#

ty dude

#

sorry for wasting your time

silk geode
#

youdidnt waste my time lol, it was my decision to spend time helping you

normal summit
#

fair enough

#

but tyt

#

ty

#

been trying to figure that out for like a hour

#

i got a quick question

#

you dont have to help me

#

but when i press play it just telports me to the void

silk geode
normal summit
solemn knollBOT
#

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

normal summit
silk geode
#

is there any extra script you added that wasnt the two?

normal summit
#

nope other then the touch grass script

#

that makes a part rainbow

silk geode
#

oh this is kinda silly, when the character is added to the game you should teleport the character to the spawnpoint

#

keep watching the tutorial, and they prob will explain it

normal summit
#

they dont they skip it

#

this the script i was trying to copy

#

he just skips how he made the checkpoint work

#

do i need to add another script?

silk geode
#

for real....

silk geode
normal summit
#

it dont work

silk geode
#

@normal summit update the leaderbored

#

game.Players.PlayerAdded:Connect(function(player)
local ls = Instance.new("Folder", player)
ls.Name = "leaderstats"
local stage = Instance.new("IntValue", ls)
stage.Value = 1
stage.Name = "Stage"
player.CharacterAdded:Connect(function(char)
char.PrimaryPart.CFrame = workspace[tostring(stage.Value)].CFrame
end)
end)

normal summit
#

nope

#

just spawns me into the void

silk geode
#

it works completly fine for me

#

where do you store the checkpoint parts?

#

like

#

what folder?

normal summit
#

2nd photo is where they are stored

silk geode
#

is that folder in the workspace?

normal summit
#

yes

silk geode
#

change this part "workspace[tostring(stage.Value)].CFrame"

#

to

#

workspace.checkpoints[tostring(stage.Value)].CFrame

normal summit
#

like this?

silk geode
#

yes

normal summit
#

nope

#

still dont work

silk geode
#

show me how the folder looks like

#

and the output tab also

normal summit
#

like where the script is placed?

#

says its not valid

silk geode
normal summit
silk geode
#

INSIDE the checkpoints folder

normal summit
silk geode
#

fr...

normal summit
#

??

#

fr...?

silk geode
#

update that part i told you earlier with this

#

workspace.checkpoints["checkpoint "..tostring(stage.Value)][tostring(stage.Value)].CFrame

normal summit
#

in the leaderbored one right?

silk geode
#

yes

normal summit
#

i did that

#

still dont work

silk geode
#

mind sending me output tab?

solemn knollBOT
#

studio** You are now Level 6! **studio

normal summit
silk geode
normal summit
#

?

#

what

solemn knollBOT
#

studio** You are now Level 4! **studio

silk geode
#

it's

#

char.PrimaryPart.CFrame = workspace.checkpoints["checkpoint "..tostring(stage.Value)][tostring(stage.Value)].CFrame

normal summit
#

all in one?

silk geode
normal summit
#

it worked..

#

but for the next checkpoint it makes me fall through the map

silk geode
#

Output tab again pls?

#

If there’s anythin

normal summit
#

Yes give me one sec