Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I properly implement remoteEvents or functions into this script? [closed]

Asked by 6 years ago
Edited 6 years ago

So this script is a script I made from scratch for a Boss' AI, everything works on the server side but on the client it's different, everything the boss does, for example when he regenerates his health, the change is being made on the server, but players cannot see it so therefore, he hasn't regenerated any lost health as far as the player is concerned. I want all Clients to see his actions.

01-- Attack Script
02hum = script.Parent.hum
03 
04actionEvent = Instance.new("RemoteEvent")
05actionEvent.Parent = game.ReplicatedStorage
06 
07players = game.Players
08 
09actions = {"REST","REGEN","ROCKET"}
10 
11function regen()
12local i=1
13repeat
14wait(0.2)
15i=i+1
View all 46 lines...

I'm having a similar problem with the Damage Script for the Rocket. The Rocket is supposed to explode on Impact.

01function Hit()
02local ex = Instance.new("Explosion")
03ex.Parent = script.Parent
04ex.Position = script.Parent.Position
05script.Parent:Destroy()
06end
07script.Parent.Touched:Connect(Hit)
08 
09wait(10)
10script.Parent:Destroy()

Any help would be appreciated.

0
i thought any changes made on the server would be automatically replicated to the client? no? GoldAngelInDisguise 297 — 6y
0
That's how it used to work, before they changed how the server communicates with the client. Inevitable_Judgement -10 — 6y
0
I don't see why this change was made, I'll have to read up about that later on. Thanks for the info. xEmmalyx 285 — 6y

Closed as Primarily Opinion-Based by User#24403, DinozCreates, Gey4Jesus69, SummerEquinox, and evaera

This question has been closed because it is a discussion about a topic focused on diverse opinions, which isn't a good fit for our Q&A format.

Why was this question closed?