#why this doesnt works?

108 messages · Page 1 of 1 (latest)

elfin sage
#

What part doesn't work

#

You just send like an entire dictionary

#

Ye I am reading

elfin sage
#

So when someone teleports

#

The script just decided to not work anymore

#

Or ou mean it as in

#

The teleporting it self doesn't work?

#

Because unless I am blind because it's gray on a black background, I don't think you have a reset

#

waiittt

fossil cosmosBOT
#

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

elfin sage
#

do you mean that if you are 2 in the queue

#

1 of you tps then the other doesnt?

#

@gleaming osprey

#

when you are in game btw

#

and it doesnt work

#

press F9

#

and see the errors

#

also you have an extra end

#

just try to remove that just incase

#
local function teleportPlayers()
    if #queue > 0 then
        btime.Time.teleporting.Enabled = true
        
        local players = {}
        
        for i = 1, #queue do
        
        if game.Players:FindFirstChild(queue[i]) then
            table.insert(players,game.Players:FindFirstChild(queue[i]))
        else
            table.remove(queue, i)
        end
    end

    local server = TeleportService:ReserveServer(placeid)
    teleporting = true
    TeleportService:TeleportToPrivateServer(placeid, server, players)
    repeat wait() until #queue <= 0
    btime.Time.teleporting.Enabled = false
    btime.Time.Text = ""
    btime.Time.TextColor3 = Color3.new(1,0,0)
end
end```
#

unless you alr have it removed

#

you see the double end?

#

at the end

#

your function teleport players

#

has a double end at the end

#

but another thing the queue just feels really odd and kinda klanky

#

cause you don't have a reset function for it

#

you don't have a limit of joining

#

so it will never stop

#

and it kinda breaks it

#

like i would tell you to remake the code, in a way where, it recieves a player in the queue

#

then it puts him within a table, as it counts down and set a variable to like "QueueisOn" to true

#

and so when other players join

#

and the count down hits 0

#

then it teleports, which enables teleporting = true

#

QueueIsOn = false

#

then it waits

#

Where did you get this code from

#

Well then I am not sure

#

Cause the code really is unorganized

#

And it has like not that great of code

#

But your best bet is remaking it completely

#

Or wait for another guy to help you, because personally I would have done the code in a completely different way.

#

It happens

#

Another way

#

To debug it

#

Put prints in important plwces

#

And just see what prints and what does not

#

Can help you see what the problem might be at

elfin sage
#

Hmm?

#

What is it?

#

Ohh, gnomecodes tower defense

#

I already used his code completely and added many custom features to it

#

But basically

#

It's cause you are playing the animation

#

Over and over

#

Make sure the animation is looped aswell

#

I am right now at uni

#

So I will respond a bit in cut times

#

Univesity

#

You sure the named are correct?

#

Can you send the code again

#

Incase you updated it

#

And press on the part that he skipped

#

And show me it's name

#

You sure it isn't 7?

#

Because the path should be exactly how you want them to walk

#

Yup

elfin sage
#

Yea

#

Can you show me a video of what you mean?

#

Can you show me the full code?

#

Did he do it that way?

#

You sure he didn't use a vector and angle?

#

Ye

#

He does later in the video or another one

#

But basically

#

You need to make the rotation look at the enemy

#

Not his position

#

You would need the angle of the enemies position compared to the tower

#

So you would kind of do it like this

#

You would get the enemy position, tower position

#

Make the enemy position - tower position and get the UNIT of that

#

Then you would use cframe to make it the character position and the character position + the calculation you did before

elfin sage
#

So wait

#

If you press the tower

#

It just stays in place or?

#

Wdym with out the raycasting

#

So it doesn't move?

#

You sure you are tracking it the entire time?

#

Do you see what the output is saying?

#

Like does it say anything at all

#

Can you put print commands

#

In like the mouse raycasting

#

And so on

#

See what it prints

#

Think on your own

#

What you need to do

#

You will never learn scripting if you only ask

#

So then you know it's not even working this part

fossil cosmosBOT
#

studio** You are now Level 7! **studio

elfin sage
#

Check why

#

You don't have anything being called after left click

#

So it doesn't do anything

fossil cosmosBOT
#

studio** You are now Level 12! **studio

elfin sage
#

I am at university man

#

I can't just help you

#

Just look at his code and yours

#

See what is missing