Hello to all
When I did the code I thought about How will other players see it
I thought to do the Remote Event I did, but there was a mistake when there isn’t such a change
So I ask for help in the forum
local Playerlocal = game.Players.LocalPlayer
local Mouse = Playerlocal:GetMouse()
local RunService = game:GetService("RunService")
local Greencopy = game.ReplicatedStorage.Greencopy.GreenVersionFoundation
--EventRemote-------------------------------------------------------------------
local EventBuildFoundation = game.ReplicatedStorage:WaitForChild("EventBuildFoundation")
--------------------------------------------------------------------------------
RunService.RenderStepped:Connect(function()
local MousePosition = Mouse.Hit.Position
Greencopy.Parent = game.Workspace
Greencopy.Position = Vector3.new(MousePosition.X,10.5,MousePosition.Z)
if Mouse.Target.Name == "Hitbox1" then
local PosMouset = Mouse.Target.Position
Greencopy.Position = Vector3.new(PosMouset.X+4,PosMouset.Y,PosMouset.Z)
end
if Mouse.Target.Name == "Hitbox8" then
local PosMouset = Mouse.Target.Position
Greencopy.Position = Vector3.new(PosMouset.X-4,PosMouset.Y,PosMouset.Z)
end
if Mouse.Target.Name == "Hitbox4" then
local PosMouset = Mouse.Target.Position
Greencopy.Position = Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z+4)
end
if Mouse.Target.Name == "Hitbox7" then
local PosMouset = Mouse.Target.Position
Greencopy.Position = Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z-4)
end
end)
Mouse.Button1Down:Connect(function()
local Model = game.ReplicatedStorage.Model.Fondation:Clone()
local PosMouset = Greencopy.Position
Model.Hitbox1.Position = Vector3.new(PosMouset.X+4,PosMouset.Y,PosMouset.Z)
Model.Hitbox8.Position = Vector3.new(PosMouset.X-4,PosMouset.Y,PosMouset.Z)
Model.Hitbox4.Position = Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z+4)
Model.Hitbox7.Position = Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z-4)
Model.Part.Position = Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z)
Model.Parent = game.Workspace
EventBuildFoundation:FireServer()
end)
and script in serverscript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EventBuildFoundation = Instance.new("RemoteEvent",ReplicatedStorage)
--------------------------------------------------------------------------
EventBuildFoundation.Name = "EventBuildFoundation"
--------------------------------------------------------------------------
local function BuildFoundation(plr,Mode,PosMouset,Hitbox1Position,Hitbox8Position,Hitbox4Position,Hitbox7Position,PartPosition,gamework,Hitbox1,Hitbox8,Hitbox4,Hitbox7,Partg,Parentmodel)
Hitbox1 = Hitbox1Position
Hitbox8 = Hitbox8Position
Hitbox4 = Hitbox4Position
Hitbox7 = Hitbox7Position
Partg = PartPosition
Parentmodel = gamework
end
--------------------------------------------------------------------------
EventBuildFoundation.OnServerEvent:Connect(BuildFoundation)
This is how I did it when the error crashed
EventBuildFoundation:FireServer(game.ReplicatedStorage.Model.Fondation:Clone(),Greencopy.Position,Vector3.new(PosMouset.X+4,PosMouset.Y,PosMouset.Z),Vector3.new(PosMouset.X-4,PosMouset.Y,PosMouset.Z),Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z+4),Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z-4),Vector3.new(PosMouset.X,PosMouset.Y,PosMouset.Z),game.Workspace,Model.Hitbox1.Position,game.Workspace,Model.Hitbox8.Position,game.Workspace,Model.Hitbox4.Position,game.Workspace,Model.Hitbox7.Position,Model.Part.Position,Model.Parent)
and in serverscript
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local EventBuildFoundation = Instance.new("RemoteEvent",ReplicatedStorage)
--------------------------------------------------------------------------
EventBuildFoundation.Name = "EventBuildFoundation"
--------------------------------------------------------------------------
local function BuildFoundation(plr,Mode,PosMouset,Hitbox1Position,Hitbox8Position,Hitbox4Position,Hitbox7Position,PartPosition,gamework,Hitbox1,Hitbox8,Hitbox4,Hitbox7,Partg,Parentmodel)
Hitbox1 = Hitbox1Position
Hitbox8 = Hitbox8Position
Hitbox4 = Hitbox4Position
Hitbox7 = Hitbox7Position
Partg = PartPosition
Parentmodel = gamework
end
--------------------------------------------------------------------------
EventBuildFoundation.OnServerEvent:Connect(BuildFoundation)