I know about that bloberous the thing I think I need to use RemoteFunction and RemoteEvent to be able for server and client sharing stuff each other for example I have a ki blast in the game the ki blast is like a tool you can select it by pressing 1 and then shot its great but its made like this
There;s one script in the ServerScriptService:
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local Object = game:GetService("ServerStorage"):WaitForChild("Blast_Model")
local physicsService = game:GetService("PhysicsService")
local Blast_Speed = 120 --// Default [120]
local Damage = 8 --// Default [8]
function NewBlast(Damage,Speed,Target,StartPos,pName)
local Blast = Object:Clone()
Blast:WaitForChild('Damage').Value = Damage
Blast.Parent = workspace
Blast.CFrame = StartPos
Blast.Velocity = ((Target - Blast.Position).unit) * Speed
local force = Instance.new'BodyForce'
force.force = Vector3.new(0, Blast:GetMass()*workspace.Gravity, 0)
force.Parent = Blast
local BlastColor = ColorSequence.new(Blast.Color)
Blast.Trail.Color = BlastColor
1 | Blast:WaitForChild( 'Owner' ).Value = pName |
2 | Blast:WaitForChild( 'Damage' ).Value = Damage |
3 | Blast:WaitForChild( 'GeneralScript' ).Disabled = false |
5 | game:GetService( "Debris" ):AddItem(Blast) |
7 | Blast:SetNetworkOwner( nil ) |
end
function CreateSound(audioID,audioVolume,pitch,debris,paren)
local link = 'rbxassetid://'
local Audio = Instance.new('Sound')
Audio.SoundId = link..audioID
Audio.Volume = audioVolume
Audio.PlaybackSpeed = pitch
Audio.Parent = paren
Audio.Name = math.random(1, 1000000) --//Names the Audio Randomly a Number from 1 to 1000000
Audio.EmitterSize = 3.5
game.Debris:AddItem(Audio,debris)
end
remotes.FireBlast.OnServerInvoke = function(player,p)
local character = player.Character
if character then
local humanoid = character:FindFirstChild("Humanoid")
if humanoid and humanoid:FindFirstChild("Animator") then
local r6_rightarmanimation = Instance.new("Animation")
r6_rightarmanimation.AnimationId = "rbxassetid://680304199"
r6_rightarmanimation = humanoid:LoadAnimation(r6_rightarmanimation)
local r6_leftarmanimation = Instance.new("Animation")
r6_leftarmanimation.AnimationId = "rbxassetid://680316109"
r6_leftarmanimation = humanoid:LoadAnimation(r6_leftarmanimation)
01 | local r 15 _rightarmanimation = Instance.new( "Animation" ) |
03 | r 15 _rightarmanimation = humanoid:LoadAnimation(r 15 _rightarmanimation) |
04 | local r 15 _leftarmanimation = Instance.new( "Animation" ) |
06 | r 15 _leftarmanimation = humanoid:LoadAnimation(r 15 _leftarmanimation) |
08 | if humanoid.RigType = = Enum.HumanoidRigType.R 6 then |
09 | local animationMATH = math.random( 1 , 2 ) |
10 | CreateSound( 145681580 ,. 3 , 1.1 , 0.8 ,character:FindFirstChild( "Head" )) |
11 | CreateSound( 853857055 ,. 5 , 1 , 1 ,character:FindFirstChild( "Head" )) |
12 | if animationMATH = = 1 then |
13 | r 6 _rightarmanimation:Play() |
15 | NewBlast(Damage,Blast_Speed,p,CFrame.new(character [ 'Right Arm' ] .RightGripAttachment.WorldPosition.X,character [ 'Right Arm' ] .RightGripAttachment.WorldPosition.Y,character [ 'Right Arm' ] .RightGripAttachment.WorldPosition.Z),player.Name) |
17 | r 6 _leftarmanimation:Play() |
19 | NewBlast(Damage,Blast_Speed,p,CFrame.new(character [ 'Left Arm' ] .LeftGripAttachment.WorldPosition.X,character [ 'Left Arm' ] .LeftGripAttachment.WorldPosition.Y,character [ 'Left Arm' ] .LeftGripAttachment.WorldPosition.Z),player.Name) |
22 | local animationMATH = math.random( 1 , 2 ) |
23 | CreateSound( 145681580 ,. 3 , 1.1 , 0.8 ,character:FindFirstChild( "Head" )) |
24 | CreateSound( 853857055 ,. 5 , 1 , 1 ,character:FindFirstChild( "Head" )) |
25 | if animationMATH = = 1 then |
26 | r 15 _rightarmanimation:Play() |
28 | NewBlast(Damage,Blast_Speed,p,CFrame.new(character [ 'RightHand' ] .RightGripAttachment.WorldPosition.X,character [ 'RightHand' ] .RightGripAttachment.WorldPosition.Y,character [ 'RightHand' ] .RightGripAttachment.WorldPosition.Z),player.Name) |
30 | r 15 _leftarmanimation:Play() |
32 | NewBlast(Damage,Blast_Speed,p,CFrame.new(character [ 'LeftHand' ] .LeftGripAttachment.WorldPosition.X,character [ 'LeftHand' ] .LeftGripAttachment.WorldPosition.Y,character [ 'LeftHand' ] .LeftGripAttachment.WorldPosition.Z),player.Name) |
end
So this script lets say for server and client that they are working together the Remote (first line of the code) is the folder with FunctionEvent its not a model but that Blast_Model (second line of the code) is placed in the ServerStorage and that Blast_Model has a script for itself
But this script actually I think activates this one so they work together this is LocalScript and its placed in StarterPack:
local remotes = game:GetService("ReplicatedStorage"):WaitForChild("Remotes")
local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")
humanoid:WaitForChild("Animator")
local mouse = player:GetMouse()
local Cooldown = 0.3 --// Default [0.2]
local debounce = false
tool.Activated:connect(function()
if not debounce then
debounce = true
local point = mouse.Hit.p
1 | remotes.FireBlast:InvokeServer(point) |
end)
local point = mouse.Hit.p
Tool.FireBlast:FireServer(point)
My question here is now can I use this method of showing server the hair model and particles (aura)
sorry for being so long