Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script not continue on from line 7 when fired from a remote event?

Asked by
bailley5 114
3 years ago

Server Script: (the one where it stops at line 7)

01game.ReplicatedStorage.IceFire.OnServerEvent:Connect(function(plr)
02    local icering = game.ReplicatedStorage.IceRing:Clone()
03 
04    icering:SetPrimaryPartCFrame(plr.Character.HumanoidRootPart.CFrame) -- teleporting the icering to the player
05 
06    icering.Parent = workspace
07    plr.Character.HumanoidRootPart.CFrame = icering.PlayerTp.CFrame -- teleporting the player above the icering
08    print("Continuing")
09    wait(0.1)
10    plr.Character.LowerTorso.Anchored = true -- anchoring the player so they dont fall
11    wait(1)
12 
13 
14 
15    icering.Sound.Playing = true -- explosion sound
View all 41 lines...

Local Script: (Fires a remote to the server when a player presses "E")

01local inputservice = game:GetService("UserInputService")
02local debounce = false
03 
04inputservice.InputBegan:Connect(function(input, isTyping)
05    if not debounce then
06    if input.KeyCode == Enum.KeyCode.E then
07            debounce = true
08            game.ReplicatedStorage.IceFire:FireServer()
09            wait(6)
10            debounce = false
11            end
12    end
13end)
0
It tps the player above the ice then stops continuing the script bailley5 114 — 3y

1 answer

Log in to vote
1
Answered by
enes223 327 Moderation Voter
3 years ago

I told this on another question too, you need to use the built-in function named "SetPrimaryPartCFrame" on the character as you used it on ice ring, just do this instead of setting the CFrame by yourself:

1plr.Character:SetPrimaryPartCFrame(icering.PlayerTp.CFrame)
Ad

Answer this question