For some reason my bindable event is not firing, its able to find it but not fire. I’m not sure what to do here.
Humanoid.Died:Connect(function()
wait(3.8)
local Character = localplayer.Character or localplayer.CharacterAdded:Wait()
print('Moved Position') -- for Debugging
localplayer.hiddenstats.Spectator.Value = true
bindableEvent:Fire(localplayer.Name)
bindableEvent.Event:Connect(onEvent)
end)
local Character = localplayer.Character or localplayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local bindableEvent = game.ServerScriptService:FindFirstChild('TeleportSpec')
local function onEvent(...)
print(...)
end
Humanoid.Died:Connect(function()
wait(3.8)
local Character = localplayer.Character or localplayer.CharacterAdded:Wait()
print('Moved Position') -- for Debugging
localplayer.hiddenstats.Spectator.Value = true
bindableEvent:Fire(localplayer.Name)
bindableEvent.Event:Connect(onEvent)
end)
oh i think the problem is that you can only put scripts in server script service. other things like the bindable event wont work in there. try putting it in server storage instead
This worked!! However the server script cant pick it up, got any ideas?
local TeleportSpec = game.ReplicatedStorage.TeleportSpec
TeleportSpec.Event:Connect(function(player)
print('recieved')
game.Players:WaitForChild(player).Character:MoveTo(Vector3.new(-70.25, 5.75, -472.5)) -- Moves Model using Vector3
end)
Another thing I’ve noticed about the first script. Is that it will only print one time, and wont work the second time. And the second script teleports me back but doesn’t print.
local players = game:GetService('Players')
local localplayer = players.LocalPlayer
local Character = localplayer.Character or localplayer.CharacterAdded:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local RemoteEvent = game.ReplicatedStorage:FindFirstChild('TeleportSpec')
Humanoid.Died:Connect(function()
wait(3.8)
local Character = localplayer.Character or localplayer.CharacterAdded:Wait()
print('Moved Position') -- for Debugging
localplayer.hiddenstats.Spectator.Value = true
RemoteEvent:FireServer(localplayer.Name)
end)