Teleport script roblox1/2/2024 ![]() Local Distance = (Vector1-Vector2).Magnitude - The distance ![]() Here's how we could check the distance: local Vector1 = Vector3.new(0,50,45) The code above will display the distance between these two 3D coordinates, which we can utilize in your situation to create a logic gate using an if statement. It's very important you enclose this vector operation in parenthesis, since the order of operations still applies, and we don't want to subtract Vector1 by Vector2.Magnitude. ![]() ![]() For example: local Vector1 = Vector3.new(0,50,45) Magnitude can give you the distance between two objects by subtracting their positions, and using this magnitude operation on the result. RemoteEvent.There's a special operation you can preform on each Vector3 value, which is called " magnitude" (or, " Magnitude"). Local Lighting = game:GetService("Lighting") If the Local Script is located in StarterCharacterScripts then this version should work: - SERVER. SecondEvent.OnClientEvent:Connect(reverseSky) RemoteEvent.OnClientEvent:Connect(function() RemoteEvent.OnClientEvent:Connect(ChadSky) Local ReplicatedStorage = game:GetService("ReplicatedStorage") Local Script: local Lighting = game:GetService("Lighting") Local player = game.Players:GetPlayerFromCharacter(hit.Parent) Local SecondEvent = ReplicatedStorage.RemoteEvents:WaitForChild("ReverseTheSky") Local RemoteEvent = ReplicatedStorage.RemoteEvents:WaitForChild("ChangeTheSky") Here is the server side script: local ReplicatedStorage = game:GetService("ReplicatedStorage") (I couldn’t record Second Player cause of an OBS bug) ![]() I tried to look in the devforums but I didn’t really find anything I did try print debugging and it always tells me that the skybox did change but for player 2 it doesnt change it and doesnt print Fired. However, for some reason the Skybox does change if I test on Studio but as soon as I do a Local Server with 2 people it gets weird, for only one player it works and not for the other. I made a script which fires a RemoteEvent and change the Skybox on Touch. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |