I am currently trying to fire a remote event that teleports a player when they touch a certain brick but whenever i touch the brick nothing happens but I get no errors.
Here are the scripts:
local GS = game.Workspace.GameService
function onTouch(hit)
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
game:GetService("ReplicatedStorage"):WaitForChild("Floor3"):FireClient(player)
end
script.Parent.Touched:Connect(onTouch)
local GS = game.Workspace.GameService
local event = game.ReplicatedStorage.Floor3
event.OnServerEvent:connect(function(player)
local char = player.Character
if not char or not char.Parent then
char = player.CharacterAdded:wait()
end
local Root = char:WaitForChild("HumanoidRootPart")
Root.Position = GS.Floor3.Position
end)
I have tried many things like firing the remote event from the command bar but it doesn’t work and I am not sure what to do, if anyone knows how to fix this so it works please let me know.
In case its needed this is the brick the player needs to come in contact with to fire the event,
Thank you!