#Ive been trying to make this for like 10 hours and it just wont work

110 messages · Page 1 of 1 (latest)

fair tulip
#

WHY ISNT THIS WORKING

#

Tp1 and Tp2 are just parts

#

plr1 is a variable that holds a player

proper sedge
#

why dont you just make it tp you to cframe.new tp1location.X, tp1location.Y, tp1location.Z

fair tulip
#

what 😭

dusk hawk
#

i made a teleporter thing

#

lemme give u da code

#

how do you want it to work

fair tulip
fair tulip
dusk hawk
#

do you want it to teleport all players in the game

#

or just a specific one

fair tulip
#

holdon let me show you what plr1 is

proper sedge
fair tulip
# dusk hawk or just a specific one
    local plr1 = nil
    local plr2 = nil

    _G.Under2Players = true

    local nr1 = 0
    local nr2 = 0

    local playersTab = {}

    repeat wait() until #game.Players:GetChildren() > 1

    for _,v in pairs(game.Players:GetChildren()) do
        table.insert(playersTab, v)
    end

    repeat
        nr1 = math.random(1, #game.Players:GetChildren())
        nr2 = math.random(1, #game.Players:GetChildren())    
        wait()    
    until nr1 ~= nr2

    _G.Under2Players = false

    plr1 = playersTab[nr1]
    plr2 = playersTab[nr2]

end```
fair tulip
#

ill try that and see if it works

proper sedge
#

i dont know your* variables so make sure to change them

dusk hawk
#

so then do

player.Character:MoveTo(workspace.teleportpart.Position)
fair tulip
#

MoveTo?

dusk hawk
#

yes

fair tulip
#

Alright ill try both of them

#

holdon

dusk hawk
#

it sets the primary part to a position

fair tulip
#

plr1 holds the person being teleported

dusk hawk
#

instead do my way

strange hazelBOT
#

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

dusk hawk
#

because his looks in workspace

#

but you are getting the players from player service

#

so you will need to get the character of the player

signal garden
dusk hawk
#

so you can straight up do

signal garden
#

Wiat let me try fix it up to you

dusk hawk
#

game.Players.plr1.Character:MoveTo(vector3)

signal garden
#

Yea this is one way to do that Or the other way is

dusk hawk
#

there are a few ways

plr1.Character:SetPrimaryPartCFrame(cframe)
plr1.Character:MoveTo(vector3)
plr1.Character:PivotTo(cframe)

signal garden
#

game. Players. Plr1. CFrame = tp1location * game.players.plr1.CFrane

#

I guess this can also be done not pretty sure

#

As typing in mobile lol

signal garden
dusk hawk
#

you arent getting the actual character model

#

you would have to do Plr1.Character

signal garden
#

So except plr1 we need to type out character

strange hazelBOT
#

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

dusk hawk
#

but again you can just really just use MoveTo() and you can skip all of the cframing

#

cuz cframes for a lot of people is very confusing

signal garden
#

Dude I never thought about move to never really found about it in the docs

#

So we can actually skip CFrames by using move to

dusk hawk
#

yes

#

you can input a vector3 and it works perfectly

signal garden
#

But what about orientation I suppose it requires CFrames

signal garden
dusk hawk
signal garden
#

I don't know what was the use CFRAMES, like why did rbx studio even bother to put it

dusk hawk
#

nah its actually really useful

#

cuz storing position and orientation simplifies so much code

signal garden
#

How would they work without CFrames

#

Any idea?

dusk hawk
#

wdym

signal garden
#

Like if we talk about plane physics in rbx studio how would that actually work can you explain?

dusk hawk
#

normally id use roblox physics like body velocity and stuff

#

cuz cframing is very expensive in the server

signal garden
#

Ok..

signal garden
dusk hawk
#

like it uses a lot more data and whatnot

signal garden
signal garden
dusk hawk
#

not really, roblox isnt helpful with this stuff

signal garden
#

So how do you learn all that?

dusk hawk
#

testing stuff

signal garden
#

Damn

dusk hawk
#

looking at other peoples code too

signal garden
#

I wanna actually know like its being really tough for me to develop in roblox I am learning from YouTube, docs but still I feel it's not enough for implementing in my game...

dusk hawk
#

it took me awhile to get the hang of coding

#

its cuz like if you are learning coding for the first time its sooooo hard

signal garden
dusk hawk
#

but like once you actually know coding and how it works you can understand other languages much better

signal garden
#

I don't actually find the programming logic difficult but the stuff roblox studio added in their engine

#

For the api

dusk hawk
#

what i mean is that when you know how things like variables and loops work, you can already learn them more in another language

signal garden
#

Of it like services, clients, events stuff

dusk hawk
#

roblox luau is dumb af imo

signal garden
#

*fax

signal garden
dusk hawk
#

i learned them off of a roblox doors video lmfao

#

this has a little bit for those

signal garden
dusk hawk
#

u can always look it up too

#

wait

#

this

#

pivot to

signal garden
#

Thanks a ton bud

dusk hawk
#

n[p

#

np

fair tulip
dusk hawk
#

part.Position

fair tulip
#
    local Tp1Location = workspace.Tp1.Position
    local Tp2Location = workspace.Tp2.Position

    game.Players.plr1.Character:MoveTo(Tp1Location)
    game.Players.plr2.Character:MoveTo(Tp3Location)
end```
#

so that should work?

fair tulip
# dusk hawk part.Position

Ok i think that works, now all I need to do is implement a leaderboard and then loop the script, I think i can find all of that on youtube