Hi, I need help to understand to how to use RemoteEvents:
I want to make a script that when a players touuches a specific part, it show a GUI message.
I’m kinda at the learning phase because I litterally need other scripters to learn how to script
So I had a script that does the same thing on the server side but it seems it’s a bad idea to other people so I decided to make another script.
Here’s the script so far: (I’m sure that 99% it’s a obvious error but i’m a noobie lol)
Server side:
game.Workspace.Islands.IslandMain.MainIsland.Reset.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
game:WaitForChild("ReplicatedStorage"):WaitForChild("RemoteThings"):WaitForChild("RemoteTeleport"):FireClient(game:WaitForChild("Players").LocalPlayer)
end
end)
Client side:
-- Script de Téléportation par Mr_RainBowsYT, fait le 19/05/20 à 23:30
--Ne pas modifier ce script si rien n'est cassé. Merci
local Spawn = game.Workspace.Islands.IslandMain.MainIsland.SpawnLocation
local AA = true
local Players = game:GetService("Players")
local TweenInformation = TweenInfo.new(1,Enum.EasingStyle.Back,Enum.EasingDirection.Out)
-- AA est un indicateur pour savoir quand un joueur est téléporté pour éviter de créer
--plusieurs requêtes de téléportation.
game:WaitForChild("ReplicatedStorage"):WaitForChild("RemoteThings"):WaitForChild("RemoteTeleport"):OnClientEvent():Connect(function(hit)
local player = Players:GetPlayerFromCharacter(hit.Parent)
local warnedGui = player:WaitForChild("PlayerGui"):WaitForChild("OceanFallWarned")
if AA == true then
AA = false
hit.Parent.HumanoidRootPart.CFrame = Spawn.CFrame*CFrame.new(0, 4, 0)
warnedGui.Enabled = true
warnedGui.Background:TweenPosition(UDim2.new(0.5, 0, 0.02, 0),"Out","Back",1)
wait(3)
warnedGui.Background:TweenPosition(UDim2.new(0.5, 0, -0.107, 0),"In","Back",1)
wait(1)
AA = true
warnedGui.Enabled = false
end
end)
(Don’t worry about the comment I wrote it in french because my native language is french)
If you could help me, I will be very thankful because i could understand RemoteEvents now
(I tried looking at the API documentation and YT videos but I understand nothing )
error I am getting :
Path:
Edit: I’m currently reading all the replies, i’m really thankful for all the people helping me