Group Game Hard Crashing

Hey

So I am trying to release a Halloween update on my group. For some reason when I go in-game and go onto a teleport part the game hard crashes making my screen go white as soon as I go onto the game. If I use admin commands and do :place me 12345689 it teleports me to the game without it crashing. Could anyone tell me why this is happening and how to fix it because this issue is really big…

Thanks!
ps I would post this in bugs but it won’t let me!

1 Like

What code is in the teleport part? It could have malicious code to crash you.

3 Likes

@ImTheBuildGuy I checked that, and I even redid my code that doesn’t help.

local TeleportService = game:GetService("TeleportService")
 
function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        TeleportService:Teleport(5350231783, player)
    end
end
 
script.Parent.Touched:connect(onTouched)

I tried looking on the group games for malicious scripts in models and there’s none…?

Strange. This does appear to be a bug.

3 Likes

Yeah, I can use admin commands to get to the games so I can tell it’s not a virus. I wonder how I can get this into bugs :frowning:

2 Likes

Not sure if this is the case, you could try adding a debounce to the Connect function. As it might be running multiple times.

I once made a brick which teleports you to a place when touched; it looked like this:

local TPService = game:GetService("TeleportService")
local PlaceId = 1234567890

script.Parent.Touched:Connect(function(hit)
	local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
	if plr then
		TPService:Teleport(PlaceId, plr)
	end
end)

Mine works just fine, it might be something in the other place is making you crash

1 Like

It might be because of

script.Parent.Touched:connect(onTouched)

is supposed to be

script.Parent.Touched:Connect(onTouched)

I am just guessing here

It isn’t the other places. There’s a game on my group I haven’t updated in nearly 2 months and it also hard crashes now. This started happening after the most recent Roblox update…

1 Like

Might wanna add some debounce to that, even though teleporting multiple times at once in theory SHOULDNT crash the game

I have just tried that, let me try it :slight_smile:

For my game it isn’t a problem, so why would it be a problem for him?

It might be that the players touching the part that many times it’s trying to spam teleport them causing lag. Maybe add some sort of check to see if they’ve already touched it. As I read someone say above, add a debounce. For example, giving them 20 seconds to teleport before somebody else can.

local TeleportService = game:GetService("TeleportService")
local debounce = false
 
function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
        debounce = true
        TeleportService:Teleport(5350231783, player)
        wait(20)
        debounce = false
    end
end
 
script.Parent.Touched:connect(onTouched)
3 Likes

Are you testing it in roblox studios or in game?
If you’re testing it in roblox it wouldn’t work, if in game it should.
Note, if it doesn’t work it’s probaly because you didn’t save the draft of the script.
image
That should be the error if you try it in roblox studio, next time I suggest checking the errors.

Btw, please close the topic if you found your solution.

1 Like

Nope I am testing this in-game. Others also have this issue on my game.

1 Like

OMG Thanks :slight_smile: It works I really appreciate that!

1 Like

It can be script.Parent.Touched:connect(onTouched). I personally use script.Parent.Touched:Connect(onTouched), because it does look better and it is not deprecated.

3 Likes