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

Script suddenly stopped working after other script fired?

Asked by 3 years ago

I am trying to create a dialog in which a model talks and then eventually disappears. I did this and this worked, except for some reason when the model is destroyed, the SEPERATE script in ServerScriptService which has not been affected at all, no longer works. To make sure the dialog script was the problem, I moved the parts that prevented the player from walking by. The seperate script works perfectly, but when I put it back and let the script destroy it, it suddenly just doesnt work. I have checked my code plenty of times, yet it still hasnt worked. Here are the two scripts:

Dialog Script in StarterPack (its a LocalScript):

01local textInterval = 0.05
02local isOldMan = false
03local isDad = false
04local plr = game.Players.LocalPlayer
05local debounce = false
06 
07function talkDialog(text)
08    for i = 1, #text do
09        if isOldMan == true then
10            local click = Instance.new("Sound",workspace.OldManMushroomShopkeeper1.Torso.TalkPart)
11            click.SoundId = "rbxassetid://410814187"
12            click.RollOffMaxDistance = 50
13            click.RollOffMinDistance = 15
14            click.PlaybackSpeed = 0.3
15            click.RollOffMode = Enum.RollOffMode.InverseTapered
View all 84 lines...

Sorry if this code is very poorly formatted, I dont know how to fix that or if it is fixable. The one that is working incorrectly is this line:

1game.ReplicatedStorage.DestroyPart:FireServer(plr)

Here is the script in ServerScriptService (The script that isnt working):

01local TS = game:GetService("TweenService")
02local debounce = false
03local Info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0)
04 
05local newBackgroundTransparency1 = {
06    BackgroundTransparency = 0
07}
08local newBackgroundTransparency2 = {
09    BackgroundTransparency = 1
10}
11local newVolume1 = {
12    Volume = .5
13}
14local newVolume2 = {
15    Volume = 0
View all 60 lines...

I am new to ScriptingHelpers, sorry if I am doing this incorrectly. Here is the script with the RemoteEvents from the Dialog Script, which is in ServerScriptService:

1game.ReplicatedStorage.FreezePlayer.OnServerEvent:Connect(function(plr)
2    plr.Character.Humanoid.WalkSpeed = 0
3    plr.Character.HumanoidRootPart.Anchored = true
4end)
5 
6game.ReplicatedStorage.UnfreezePlayer.OnServerEvent:Connect(function(plr)
7    plr.Character.Humanoid.WalkSpeed = 16
8    plr.Character.HumanoidRootPart.Anchored = false
9end)

I feel like the RemoteEvents script is unneccassary to show, but its there anyway. Any help would be appreciated. Thanks!

1 answer

Log in to vote
0
Answered by
xxaxxaz 42
3 years ago

you do not need a script for diolague. just do the original way.

0
Thank you for your reply. I will use this way in the future. LikeableEmmec 470 — 3y
Ad

Answer this question