i want to know why i cant change a part’s position in server by script.i made a skill to shoot a part by Bessel curve.So i make a tool.when it activates the local script will fire a (“Fire”,Mouse.hit.position) to server.And the script will shoot the part.
Here is my test videos and pictures
robloxapp-20240703-2232030.wmv (301.9 KB)
robloxapp-20240703-2232208.wmv (520.6 KB)
script.Parent.Fire.OnServerEvent:Connect(function(player,fire,mhp)
if fire == "Fire" then
if player and player.Character and player.Character:FindFirstChild("Humanoid") and player.Character.Humanoid.Health > 0 and player.Character:FindFirstChild("Head") and player.Character:FindFirstChild("HumanoidRootPart") then
local char = player.Character
local sunclone = script.Sun.Centerpart:Clone()
sunclone.Name = "SUN EXPLOTION"
sunclone.Parent = game.Workspace
local changep
sunclone.CFrame = CFrame.new(char.Head.Position + Vector3.new(0,20,0))
game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(1,Enum.EasingStyle.Back),{Size = Vector3.new(8,8,8),Transparency = 0.6}):Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(1,Enum.EasingStyle.Back),{Size = Vector3.new(7,7,7),Transparency = 0.2}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(1,Enum.EasingStyle.Back),{Size = Vector3.new(8,8,8)}):Play()
local weld = Instance.new("WeldConstraint",char.HumanoidRootPart)
weld.Part0 = char.HumanoidRootPart
weld.Part1 = sunclone
local damage = 60
if player:FindFirstChild("Damage") then
damage *= player.Damage.Value
end
task.wait(1)
script["Knife Swoosh Thick Gunshot Like Throw Into A (SFX)"]:Play()
local controlpoint= CFrame.new(sunclone.Position:Lerp(mhp,0.2)+ Vector3.new(0,75,0)).Position
local tm = 0
local reached = false
local touchlist = {}
local touchlist2 = {}
sunclone.Afterwave.Touched:Connect(function(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= player.Character and hit.Parent.Humanoid.Health > 0 then
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if touchlist2[game.Players:GetPlayerFromCharacter(hit.Parent).UserId] then return end
touchlist2[game.Players:GetPlayerFromCharacter(hit.Parent).UserId] = true
else
if touchlist2[hit.Parent.Name] then return end
touchlist2[hit.Parent.Name] = true
end
player.Character.Humanoid.PlatformStand = false
hit.Parent.Humanoid:TakeDamage(damage/4)
if not hit.Parent.Humanoid:FindFirstChild("creator") then
local creator = Instance.new("ObjectValue",hit.Parent.Humanoid)
creator.Name = "creator"
creator.Value = player
game.Debris:AddItem(creator,2)
else
hit.Parent.Humanoid.creator:Destroy()
local creator = Instance.new("ObjectValue",hit.Parent.Humanoid)
creator.Name = "creator"
creator.Value = player
game.Debris:AddItem(creator,2)
end
else return
end
end)
sunclone.HitBox.Touched:Connect(function(hit)
if hit.Parent and hit.Parent:FindFirstChild("Humanoid") and hit.Parent ~= player.Character and hit.Parent.Humanoid.Health > 0 then
if game.Players:GetPlayerFromCharacter(hit.Parent) then
if touchlist[game.Players:GetPlayerFromCharacter(hit.Parent).UserId] then return end
touchlist[game.Players:GetPlayerFromCharacter(hit.Parent).UserId] = true
else
if touchlist[hit.Parent.Name] then return end
touchlist[hit.Parent.Name] = true
end
player.Character.Humanoid.PlatformStand = false
hit.Parent.Humanoid:TakeDamage(damage)
if not hit.Parent.Humanoid:FindFirstChild("creator") then
local creator = Instance.new("ObjectValue",hit.Parent.Humanoid)
creator.Name = "creator"
creator.Value = player
game.Debris:AddItem(creator,2)
else
hit.Parent.Humanoid.creator:Destroy()
local creator = Instance.new("ObjectValue",hit.Parent.Humanoid)
creator.Name = "creator"
creator.Value = player
game.Debris:AddItem(creator,2)
end
else return
end
end)
sunclone.Centerpart.Touched:Connect(function(hit)
if hit.CanCollide == true then
if not reached then
sunclone["Power Outage"]:Play()
local t = game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(1,1,1),Transparency = 0.5})
t.Completed:Connect(function()
task.wait(0.5)
sunclone.Explosion_Big2:Play()
game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(300,300,300),Transparency = 0.5}):Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250),Transparency = 0.1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(300,300,300)}):Play()
local t2 = game.TweenService:Create(sunclone.Afterwave,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(350,350,100),Transparency = 0.5})
t2.Completed:Connect(function()
game.TweenService:Create(sunclone.Afterwave,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = Vector3.new(400,400,100),Transparency = 1}):Play()
end)
t2:Play()
task.wait(5)
t = game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250),Transparency = 1})
t.Completed:Connect(function()
task.wait(0.1)
sunclone:Destroy()
end)
t:Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(230,230,230),Transparency = 1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250)}):Play()
end)
t:Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(0.8,0.8,0.8),Transparency = 0.1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(1,1,1)}):Play()
end
end
end)
if weld then
weld:Destroy()
end
sunclone.Anchored = true
local sunp = sunclone.Position
if (sunp - mhp).Magnitude > 1000 then
mhp = CFrame.new(mhp,sunp).LookVector * -1000
end
changep = game["Run Service"].Stepped:Connect(function(t,dt)
if reached then
changep:Disconnect()
return
end
tm += dt
local p1 = sunp:Lerp(controlpoint,tm/2)
local p2 = controlpoint:Lerp(mhp,tm/2)
sunclone.Position = p1:Lerp(p2,tm/2)
if tm >= 2 then
reached = true
changep:Disconnect()
sunclone["Power Outage"]:Play()
local t = game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(1,1,1),Transparency = 0.5})
t.Completed:Connect(function()
task.wait(0.5)
sunclone.Explosion_Big2:Play()
game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(300,300,300),Transparency = 0.5}):Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250),Transparency = 0.1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(300,300,300)}):Play()
local t2 = game.TweenService:Create(sunclone.Afterwave,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(350,350,100),Transparency = 0.5})
t2.Completed:Connect(function()
game.TweenService:Create(sunclone.Afterwave,TweenInfo.new(1,Enum.EasingStyle.Linear),{Size = Vector3.new(400,400,100),Transparency = 1}):Play()
end)
t2:Play()
task.wait(5)
t = game.TweenService:Create(sunclone.Bigsun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250),Transparency = 1})
t.Completed:Connect(function()
task.wait(0.1)
sunclone:Destroy()
end)
t:Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(230,230,230),Transparency = 1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(2,Enum.EasingStyle.Back),{Size = Vector3.new(250,250,250)}):Play()
end)
t:Play()
game.TweenService:Create(sunclone.LittleSun,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(0.8,0.8,0.8),Transparency = 0.1}):Play()
game.TweenService:Create(sunclone.HitBox,TweenInfo.new(3,Enum.EasingStyle.Back),{Size = Vector3.new(1,1,1)}):Play()
end
end)
end
end
end)
i tried all runservice events.